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.
This commit is contained in:
Guido van Rossum 2004-02-19 19:16:50 +00:00
parent fa6c6f8a73
commit bbca8da3ca
1 changed files with 4 additions and 2 deletions

View File

@ -183,7 +183,9 @@ def fullmodname(path):
base = path[len(longest) + 1:]
else:
base = path
base = base.replace("/", ".")
base = base.replace(os.sep, ".")
if os.altsep:
base = base.replace(os.altsep, ".")
filename, ext = os.path.splitext(base)
return filename
@ -297,7 +299,7 @@ class CoverageResults:
except IOError, err:
print >> sys.stderr, ("trace: Could not open %r for writing: %s"
"- skipping" % (path, err))
return
return 0, 0
n_lines = 0
n_hits = 0