Protect abs__file__() from changes to sys.modules while it's running.
This commit is contained in:
parent
024da5c257
commit
7ac9d40201
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue