##// END OF EJS Templates
Fix autoreload tests
Thomas Kluyver -
Show More
@@ -186,9 +186,9 b' class ModuleReloader(object):'
186 return
186 return
187
187
188 if check_all or self.check_all:
188 if check_all or self.check_all:
189 modules = sys.modules.keys()
189 modules = list(sys.modules.keys())
190 else:
190 else:
191 modules = self.modules.keys()
191 modules = list(self.modules.keys())
192
192
193 for modname in modules:
193 for modname in modules:
194 m = sys.modules.get(modname, None)
194 m = sys.modules.get(modname, None)
@@ -258,7 +258,7 b' def update_function(old, new):'
258 def update_class(old, new):
258 def update_class(old, new):
259 """Replace stuff in the __dict__ of a class, and upgrade
259 """Replace stuff in the __dict__ of a class, and upgrade
260 method code objects"""
260 method code objects"""
261 for key in old.__dict__.keys():
261 for key in list(old.__dict__.keys()):
262 old_obj = getattr(old, key)
262 old_obj = getattr(old, key)
263
263
264 try:
264 try:
@@ -339,7 +339,7 b' def superreload(module, reload=reload, old_objects={}):'
339 """
339 """
340
340
341 # collect old objects in the module
341 # collect old objects in the module
342 for name, obj in module.__dict__.items():
342 for name, obj in list(module.__dict__.items()):
343 if not hasattr(obj, '__module__') or obj.__module__ != module.__name__:
343 if not hasattr(obj, '__module__') or obj.__module__ != module.__name__:
344 continue
344 continue
345 key = (module.__name__, name)
345 key = (module.__name__, name)
@@ -370,7 +370,7 b' def superreload(module, reload=reload, old_objects={}):'
370 raise
370 raise
371
371
372 # iterate over all objects and update functions & classes
372 # iterate over all objects and update functions & classes
373 for name, new_obj in module.__dict__.items():
373 for name, new_obj in list(module.__dict__.items()):
374 key = (module.__name__, name)
374 key = (module.__name__, name)
375 if key not in old_objects: continue
375 if key not in old_objects: continue
376
376
@@ -473,9 +473,8 b' class AutoreloadMagics(Magics):'
473 """
473 """
474 modname = parameter_s
474 modname = parameter_s
475 if not modname:
475 if not modname:
476 to_reload = self._reloader.modules.keys()
476 to_reload = sorted(self._reloader.modules.keys())
477 to_reload.sort()
477 to_skip = sorted(self._reloader.skip_modules.keys())
478 to_skip = self._reloader.skip_modules.keys()
479 to_skip.sort()
478 to_skip.sort()
480 if stream is None:
479 if stream is None:
481 stream = sys.stdout
480 stream = sys.stdout
General Comments 0
You need to be logged in to leave comments. Login now