mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
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:
parent
7731dfdaad
commit
4703211080
10 changed files with 159 additions and 30 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue