Patch #1536071: trace.py should now find the full module name of a

file correctly even on Windows.
This commit is contained in:
Georg Brandl 2006-08-14 21:55:28 +00:00
parent 85fec59104
commit 7a1af770b9
2 changed files with 6 additions and 1 deletions

View file

@ -179,9 +179,11 @@ def fullmodname(path):
# looking in sys.path for the longest matching prefix. We'll
# assume that the rest is the package name.
comparepath = os.path.normcase(path)
longest = ""
for dir in sys.path:
if path.startswith(dir) and path[len(dir)] == os.path.sep:
dir = os.path.normcase(dir)
if comparepath.startswith(dir) and comparepath[len(dir)] == os.sep:
if len(dir) > len(longest):
longest = dir

View file

@ -64,6 +64,9 @@ Core and builtins
Library
-------
- Patch #1536071: trace.py should now find the full module name of a
file correctly even on Windows.
- logging's atexit hook now runs even if the rest of the module has
already been cleaned up.