summaryrefslogtreecommitdiff
path: root/Lib/trace.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-08-01 14:38:17 +0000
committerGeorg Brandl <georg@python.org>2010-08-01 14:38:17 +0000
commit120d633871a950d82194f2507c5ccaea284c69d6 (patch)
treed269e351bcf2026c612df9a7aafc73d430546708 /Lib/trace.py
parent272fc1023aa8e2eab7c369e6a5647915013459a3 (diff)
downloadcpython-git-120d633871a950d82194f2507c5ccaea284c69d6.tar.gz
#4943: do not try to include drive letters (and colons) when looking for a probably module name.
Diffstat (limited to 'Lib/trace.py')
-rw-r--r--Lib/trace.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/trace.py b/Lib/trace.py
index 236ea49dd9..493c4e83df 100644
--- a/Lib/trace.py
+++ b/Lib/trace.py
@@ -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,