summaryrefslogtreecommitdiffstats
path: root/Lib/site.py
diff options
context:
space:
mode:
authorPhillip J. Eby <pje@telecommunity.com>2006-04-11 01:07:43 (GMT)
committerPhillip J. Eby <pje@telecommunity.com>2006-04-11 01:07:43 (GMT)
commit470321108019367e3bdd96309e89d79f04784d45 (patch)
tree67bb4c26a4a2e14eef1999eed390091620a850fa /Lib/site.py
parent7731dfdaad96c519d80823782ca4c81d09466e8d (diff)
downloadcpython-470321108019367e3bdd96309e89d79f04784d45.zip
cpython-470321108019367e3bdd96309e89d79f04784d45.tar.gz
cpython-470321108019367e3bdd96309e89d79f04784d45.tar.bz2
Updated the warnings, linecache, inspect, traceback, site, and doctest modules
to work correctly with modules imported from zipfiles or via other PEP 302 __loader__ objects. Tests and doc updates are included.
Diffstat (limited to 'Lib/site.py')
-rw-r--r--Lib/site.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/site.py b/Lib/site.py
index 6818e85..8074979 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -69,6 +69,8 @@ def makepath(*paths):
def abs__file__():
"""Set all module' __file__ attribute to an absolute path"""
for m in sys.modules.values():
+ if hasattr(m,'__loader__'):
+ continue # don't mess with a PEP 302-supplied __file__
try:
m.__file__ = os.path.abspath(m.__file__)
except AttributeError: