Commit 634e53fa authored by Guido van Rossum's avatar Guido van Rossum

Fix a bizarre error where test_pickletools fails if preceded by test_pyclbr.

The fix is in neither, but in pickle.py where a loop over sys.modules.items()
could modify sys.modules, occasionally.
parent 032a2847
......@@ -791,7 +791,7 @@ def whichmodule(func, funcname):
if func in classmap:
return classmap[func]
for name, module in sys.modules.items():
for name, module in list(sys.modules.items()):
if module is None:
continue # skip dummy package entries
if name != '__main__' and getattr(module, funcname, None) is func:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment