mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Patch #1536071: trace.py should now find the full module name of a
file correctly even on Windows.
This commit is contained in:
parent
85fec59104
commit
7a1af770b9
2 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue