##// END OF EJS Templates
remove python2 code
Srinivas Reddy Thatiparthy -
Show More
@@ -260,12 +260,9 b' class ModuleReloader(object):'
260 # superreload
260 # superreload
261 #------------------------------------------------------------------------------
261 #------------------------------------------------------------------------------
262
262
263 if PY3:
263
264 func_attrs = ['__code__', '__defaults__', '__doc__',
264 func_attrs = ['__code__', '__defaults__', '__doc__',
265 '__closure__', '__globals__', '__dict__']
265 '__closure__', '__globals__', '__dict__']
266 else:
267 func_attrs = ['func_code', 'func_defaults', 'func_doc',
268 'func_closure', 'func_globals', 'func_dict']
269
266
270
267
271 def update_function(old, new):
268 def update_function(old, new):
@@ -320,18 +317,9 b' UPDATE_RULES = ['
320 (lambda a, b: isinstance2(a, b, property),
317 (lambda a, b: isinstance2(a, b, property),
321 update_property),
318 update_property),
322 ]
319 ]
323
320 UPDATE_RULES.extend([(lambda a, b: isinstance2(a, b, types.MethodType),
324
321 lambda a, b: update_function(a.__func__, b.__func__)),
325 if PY3:
322 ])
326 UPDATE_RULES.extend([(lambda a, b: isinstance2(a, b, types.MethodType),
327 lambda a, b: update_function(a.__func__, b.__func__)),
328 ])
329 else:
330 UPDATE_RULES.extend([(lambda a, b: isinstance2(a, b, types.ClassType),
331 update_class),
332 (lambda a, b: isinstance2(a, b, types.MethodType),
333 lambda a, b: update_function(a.__func__, b.__func__)),
334 ])
335
323
336
324
337 def update_generic(a, b):
325 def update_generic(a, b):
General Comments 0
You need to be logged in to leave comments. Login now