@@ -27,7 +27,7 @@ def _next(o):
27
27
return o .next ()
28
28
29
29
30
- class SetupLuaRuntimeMixin ( object ) :
30
+ class SetupLuaRuntimeMixin :
31
31
lua_runtime_kwargs = {}
32
32
33
33
def setUp (self ):
@@ -262,10 +262,7 @@ def test_none(self):
262
262
263
263
def test_pybuiltins (self ):
264
264
function = self .lua .eval ('function() return python.builtins end' )
265
- try :
266
- import __builtin__ as builtins
267
- except ImportError :
268
- import builtins
265
+ import builtins
269
266
self .assertEqual (builtins , function ())
270
267
271
268
def test_pybuiltins_disabled (self ):
@@ -290,7 +287,7 @@ def test_call_str_py(self):
290
287
291
288
def test_call_str_class (self ):
292
289
called = [False ]
293
- class test ( object ) :
290
+ class test :
294
291
def __str__ (self ):
295
292
called [0 ] = True
296
293
return 'STR!!'
@@ -837,14 +834,14 @@ def test_pysetitem(self):
837
834
838
835
def test_pygetattr (self ):
839
836
lua_func = self .lua .eval ('function(x) return x.ATTR end' )
840
- class test ( object ) :
837
+ class test :
841
838
def __init__ (self ):
842
839
self .ATTR = 5
843
840
self .assertEqual (test ().ATTR , lua_func (test ()))
844
841
845
842
def test_pysetattr (self ):
846
843
lua_func = self .lua .eval ('function(x) x.ATTR = 123 end' )
847
- class test ( object ) :
844
+ class test :
848
845
def __init__ (self ):
849
846
self .ATTR = 5
850
847
t = test ()
@@ -943,7 +940,7 @@ def attr_filter(obj, name, setting):
943
940
944
941
lua = self .lupa .LuaRuntime (attribute_filter = attr_filter )
945
942
function = lua .eval ('function(obj) return obj.__name__ end' )
946
- class X ( object ) :
943
+ class X :
947
944
a = 0
948
945
a1 = 1
949
946
_a = 2
@@ -1049,14 +1046,14 @@ def test_pysetitem(self):
1049
1046
1050
1047
def test_pygetattr (self ):
1051
1048
lua_func = self .lua .eval ('function(x) return x.ATTR end' )
1052
- class test ( object ) :
1049
+ class test :
1053
1050
def __init__ (self ):
1054
1051
self .ATTR = 5
1055
1052
self .assertEqual (test ().ATTR , lua_func (test ()))
1056
1053
1057
1054
def test_pysetattr (self ):
1058
1055
lua_func = self .lua .eval ('function(x) x.ATTR = 123 end' )
1059
- class test ( object ) :
1056
+ class test :
1060
1057
def __init__ (self ):
1061
1058
self .ATTR = 5
1062
1059
t = test ()
@@ -1078,7 +1075,7 @@ def test_call_str_py(self):
1078
1075
1079
1076
def test_call_str_class (self ):
1080
1077
called = [False ]
1081
- class test ( object ) :
1078
+ class test :
1082
1079
def __str__ (self ):
1083
1080
called [0 ] = True
1084
1081
return 'STR!!'
@@ -1100,13 +1097,13 @@ def tearDown(self):
1100
1097
self .lua = None
1101
1098
gc .collect ()
1102
1099
1103
- class X ( object ) :
1100
+ class X :
1104
1101
a = 0
1105
1102
a1 = 1
1106
1103
_a = 2
1107
1104
__a = 3
1108
1105
1109
- class Y ( object ) :
1106
+ class Y :
1110
1107
a = 0
1111
1108
a1 = 1
1112
1109
_a = 2
@@ -1282,7 +1279,7 @@ def test_pyobject_wrapping_callable(self):
1282
1279
lua_type = self .lua .eval ('type' )
1283
1280
lua_get_call = self .lua .eval ('function(obj) return getmetatable(obj).__call end' )
1284
1281
1285
- class Callable ( object ) :
1282
+ class Callable :
1286
1283
def __call__ (self ): pass
1287
1284
def __getitem__ (self , item ): pass
1288
1285
@@ -1293,7 +1290,7 @@ def test_pyobject_wrapping_getitem(self):
1293
1290
lua_type = self .lua .eval ('type' )
1294
1291
lua_get_index = self .lua .eval ('function(obj) return getmetatable(obj).__index end' )
1295
1292
1296
- class GetItem ( object ) :
1293
+ class GetItem :
1297
1294
def __getitem__ (self , item ): pass
1298
1295
1299
1296
self .assertEqual ('userdata' , lua_type (GetItem ()))
@@ -1303,7 +1300,7 @@ def test_pyobject_wrapping_getattr(self):
1303
1300
lua_type = self .lua .eval ('type' )
1304
1301
lua_get_index = self .lua .eval ('function(obj) return getmetatable(obj).__index end' )
1305
1302
1306
- class GetAttr ( object ) :
1303
+ class GetAttr :
1307
1304
pass
1308
1305
1309
1306
self .assertEqual ('userdata' , lua_type (GetAttr ()))
@@ -2234,7 +2231,7 @@ def setUp(self):
2234
2231
2235
2232
self .lua = self .lupa .LuaRuntime (unpack_returned_tuples = True )
2236
2233
2237
- class C ( object ) :
2234
+ class C :
2238
2235
def __init__ (self , x ):
2239
2236
self .x = int (x )
2240
2237
@@ -2364,19 +2361,19 @@ def func_3(x, y, z='default'):
2364
2361
return ("x=%s, y=%s, z=%s" % (x , y , z ))
2365
2362
2366
2363
2367
- class MyCls_1 ( object ) :
2364
+ class MyCls_1 :
2368
2365
@lupa .unpacks_lua_table_method
2369
2366
def meth (self , x ):
2370
2367
return ("x=%s" % (x ,))
2371
2368
2372
2369
2373
- class MyCls_2 ( object ) :
2370
+ class MyCls_2 :
2374
2371
@lupa .unpacks_lua_table_method
2375
2372
def meth (self , x , y ):
2376
2373
return ("x=%s, y=%s" % (x , y ))
2377
2374
2378
2375
2379
- class MyCls_3 ( object ) :
2376
+ class MyCls_3 :
2380
2377
@lupa .unpacks_lua_table_method
2381
2378
def meth (self , x , y , z = 'default' ):
2382
2379
return ("x=%s, y=%s, z=%s" % (x , y , z ))
@@ -2520,11 +2517,7 @@ class NoEncodingMethodKwargsDecoratorTest(MethodKwargsDecoratorTest):
2520
2517
################################################################################
2521
2518
# tests for the FastRLock implementation
2522
2519
2523
- try :
2524
- from thread import start_new_thread , get_ident
2525
- except ImportError :
2526
- # Python 3?
2527
- from _thread import start_new_thread , get_ident
2520
+ from _thread import start_new_thread , get_ident
2528
2521
2529
2522
2530
2523
def _wait ():
@@ -2552,7 +2545,7 @@ def setUp(self):
2552
2545
def tearDown (self ):
2553
2546
gc .collect ()
2554
2547
2555
- class Bunch ( object ) :
2548
+ class Bunch :
2556
2549
"""
2557
2550
A bunch of threads.
2558
2551
"""
0 commit comments