Commit b6992aa8 authored by Guido van Rossum's avatar Guido van Rossum

Fix two small bugs: (1) on Windows, pathname munging didn't work

right; (2) write_results_file() didn't return a tuple of two ints when
it couldn't create the file.  Will backport.
parent 97478344
...@@ -183,7 +183,9 @@ def fullmodname(path): ...@@ -183,7 +183,9 @@ def fullmodname(path):
base = path[len(longest) + 1:] base = path[len(longest) + 1:]
else: else:
base = path base = path
base = base.replace("/", ".") base = base.replace(os.sep, ".")
if os.altsep:
base = base.replace(os.altsep, ".")
filename, ext = os.path.splitext(base) filename, ext = os.path.splitext(base)
return filename return filename
...@@ -297,7 +299,7 @@ class CoverageResults: ...@@ -297,7 +299,7 @@ class CoverageResults:
except IOError, err: except IOError, err:
print >> sys.stderr, ("trace: Could not open %r for writing: %s" print >> sys.stderr, ("trace: Could not open %r for writing: %s"
"- skipping" % (path, err)) "- skipping" % (path, err))
return return 0, 0
n_lines = 0 n_lines = 0
n_hits = 0 n_hits = 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment