[Python-checkins] r83405 - python/branches/py3k/Lib/trace.py

georg.brandl python-checkins at python.org
Sun Aug 1 16:38:17 CEST 2010


Author: georg.brandl
Date: Sun Aug  1 16:38:17 2010
New Revision: 83405

Log:
#4943: do not try to include drive letters (and colons) when looking for a probably module name.

Modified:
   python/branches/py3k/Lib/trace.py

Modified: python/branches/py3k/Lib/trace.py
==============================================================================
--- python/branches/py3k/Lib/trace.py	(original)
+++ python/branches/py3k/Lib/trace.py	Sun Aug  1 16:38:17 2010
@@ -192,11 +192,13 @@
         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,


More information about the Python-checkins mailing list