Commit 7ac9d402 authored by Guido van Rossum's avatar Guido van Rossum

Protect abs__file__() from changes to sys.modules while it's running.

parent 024da5c2
......@@ -69,7 +69,7 @@ def makepath(*paths):
def abs__file__():
"""Set all module' __file__ attribute to an absolute path"""
for m in sys.modules.values():
for m in set(sys.modules.values()):
if hasattr(m, '__loader__'):
continue # don't mess with a PEP 302-supplied __file__
try:
......
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