mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Protect abs__file__() from changes to sys.modules while it's running.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user