@@ -729,7 +729,7 @@ def getmodule(object, _filename=None): |
|
|
729 |
729 |
return sys.modules.get(modulesbyfile[file]) |
730 |
730 |
# Update the filename to module name cache and check yet again |
731 |
731 |
# Copy sys.modules in order to cope with changes while iterating |
732 |
|
-for modname, module in list(sys.modules.items()): |
|
732 |
+for modname, module in sys.modules.copy().items(): |
733 |
733 |
if ismodule(module) and hasattr(module, '__file__'): |
734 |
734 |
f = module.__file__ |
735 |
735 |
if f == _filesbymodname.get(modname, None): |