]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#4943: do not try to include drive letters (and colons) when looking for a probably...
authorGeorg Brandl <georg@python.org>
Sun, 1 Aug 2010 14:38:17 +0000 (14:38 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 1 Aug 2010 14:38:17 +0000 (14:38 +0000)
Lib/trace.py

index 236ea49dd9d953414d24db2545a8e67ea1c0dfd0..493c4e83df0217489c25609920d9f7086e06b66c 100644 (file)
@@ -192,11 +192,13 @@ def fullmodname(path):
         base = path[len(longest) + 1:]
     else:
         base = path
+    # the drive letter is never part of the module name
+    drive, base = os.path.splitdrive(base)
     base = base.replace(os.sep, ".")
     if os.altsep:
         base = base.replace(os.altsep, ".")
     filename, ext = os.path.splitext(base)
-    return filename
+    return filename.lstrip(".")
 
 class CoverageResults:
     def __init__(self, counts=None, calledfuncs=None, infile=None,