mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
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.
This commit is contained in:
parent
032a284752
commit
634e53fad4
1 changed files with 1 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue