summaryrefslogtreecommitdiffstats
path: root/Lib/site.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2010-04-17 00:19:56 (GMT)
committerBarry Warsaw <barry@python.org>2010-04-17 00:19:56 (GMT)
commit28a691b7fdde1b8abafa4c4a5025e6bfa44f48b9 (patch)
treeca0098063694e0f91d1bcd785d0044e96e1bf389 /Lib/site.py
parent0e59cc3fc347582d8625050de258a2dd6b87f978 (diff)
downloadcpython-28a691b7fdde1b8abafa4c4a5025e6bfa44f48b9.zip
cpython-28a691b7fdde1b8abafa4c4a5025e6bfa44f48b9.tar.gz
cpython-28a691b7fdde1b8abafa4c4a5025e6bfa44f48b9.tar.bz2
PEP 3147
Diffstat (limited to 'Lib/site.py')
-rw-r--r--Lib/site.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/site.py b/Lib/site.py
index 55e662c..d99b538 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -74,15 +74,19 @@ def makepath(*paths):
return dir, os.path.normcase(dir)
-def abs__file__():
- """Set all module' __file__ attribute to an absolute path"""
+def abs_paths():
+ """Set all module __file__ and __cached__ attributes to an absolute path"""
for m in set(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:
- continue
+ pass
+ try:
+ m.__cached__ = os.path.abspath(m.__cached__)
+ except AttributeError:
+ pass
def removeduppaths():
@@ -518,7 +522,7 @@ def execusercustomize():
def main():
global ENABLE_USER_SITE
- abs__file__()
+ abs_paths()
known_paths = removeduppaths()
if (os.name == "posix" and sys.path and
os.path.basename(sys.path[-1]) == "Modules"):