]> granicus.if.org Git - python/commitdiff
Patch #1536071: trace.py should now find the full module name of a
authorGeorg Brandl <georg@python.org>
Mon, 14 Aug 2006 21:55:28 +0000 (21:55 +0000)
committerGeorg Brandl <georg@python.org>
Mon, 14 Aug 2006 21:55:28 +0000 (21:55 +0000)
file correctly even on Windows.

Lib/trace.py
Misc/NEWS

index db36e1d21dd94b8db47f6f270a5365545b8c82bf..35edac2eead7a3c0dd0e7c07944b1c6d74f7d3e7 100644 (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
 
index 06dde4aeec764e135b4a855ff7860b29bf8943eb..7e945604eb500583e3aa5f46ef8d24f4dce5b0bf 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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.