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.
This commit is contained in:
Phillip J. Eby 2006-04-11 01:07:43 +00:00
parent 7731dfdaad
commit 4703211080
10 changed files with 159 additions and 30 deletions

View file

@ -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: