]> granicus.if.org Git - python/commitdiff
The fullmodname() function chopped off the first character if the
authorGuido van Rossum <guido@python.org>
Fri, 10 Oct 2003 23:02:01 +0000 (23:02 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 10 Oct 2003 23:02:01 +0000 (23:02 +0000)
module existed in the current directory.  Fix this.  Backport
candidate (I presume).

Lib/trace.py

index 0f27273f5f1227a391042a49334e427a18f9a09e..3da9cdd1047f3dc0ccbc03265fd367834f58c74a 100644 (file)
@@ -180,7 +180,11 @@ def fullmodname(path):
             if len(dir) > len(longest):
                 longest = dir
 
-    base = path[len(longest) + 1:].replace("/", ".")
+    if longest:
+        base = path[len(longest) + 1:]
+    else:
+        base = path
+    base = base.replace("/", ".")
     filename, ext = os.path.splitext(base)
     return filename
 
@@ -291,6 +295,9 @@ class CoverageResults:
     def write_results_file(self, path, lines, lnotab, lines_hit):
         """Return a coverage results file in path."""
 
+        print "path =", `path`
+        if "/arse" in path:
+            import pdb; pdb.set_trace()
         try:
             outfile = open(path, "w")
         except IOError, err: