From 7ac9d4020100b99b17eeddf65bafa8e87f9f293a Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 18 May 2007 00:24:43 +0000 Subject: Protect abs__file__() from changes to sys.modules while it's running. --- Lib/site.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- cgit v0.12