diff options
author | Guido van Rossum <guido@python.org> | 2007-05-18 00:24:43 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-05-18 00:24:43 (GMT) |
commit | 7ac9d4020100b99b17eeddf65bafa8e87f9f293a (patch) | |
tree | d7145b91dbe6e301e8adc0bd468ddcdad7169305 /Lib/site.py | |
parent | 024da5c2576f196dede4bfa0fc5808019bd54fd8 (diff) | |
download | cpython-7ac9d4020100b99b17eeddf65bafa8e87f9f293a.zip cpython-7ac9d4020100b99b17eeddf65bafa8e87f9f293a.tar.gz cpython-7ac9d4020100b99b17eeddf65bafa8e87f9f293a.tar.bz2 |
Protect abs__file__() from changes to sys.modules while it's running.
Diffstat (limited to 'Lib/site.py')
-rw-r--r-- | Lib/site.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/site.py b/Lib/site.py index ba8603c..47196e4 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -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: |