mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
#4943: do not try to include drive letters (and colons) when looking for a probably module name.
This commit is contained in:
parent
272fc1023a
commit
120d633871
1 changed files with 3 additions and 1 deletions
|
@ -192,11 +192,13 @@ def fullmodname(path):
|
||||||
base = path[len(longest) + 1:]
|
base = path[len(longest) + 1:]
|
||||||
else:
|
else:
|
||||||
base = path
|
base = path
|
||||||
|
# the drive letter is never part of the module name
|
||||||
|
drive, base = os.path.splitdrive(base)
|
||||||
base = base.replace(os.sep, ".")
|
base = base.replace(os.sep, ".")
|
||||||
if os.altsep:
|
if os.altsep:
|
||||||
base = base.replace(os.altsep, ".")
|
base = base.replace(os.altsep, ".")
|
||||||
filename, ext = os.path.splitext(base)
|
filename, ext = os.path.splitext(base)
|
||||||
return filename
|
return filename.lstrip(".")
|
||||||
|
|
||||||
class CoverageResults:
|
class CoverageResults:
|
||||||
def __init__(self, counts=None, calledfuncs=None, infile=None,
|
def __init__(self, counts=None, calledfuncs=None, infile=None,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue