diff options
author | Valentin Lab <valentin.lab@kalysto.org> | 2020-12-14 16:19:29 +0100 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-01-17 17:10:25 -0500 |
commit | dc0e80657257def9203b5e0ca7b6141d3dcd1d57 (patch) | |
tree | e3aad5d5dd5db9a2ae2f27bac804418db5d71998 /coverage/files.py | |
parent | b0710b1fc868db5c385b3d30a2fab49a2aeb2e81 (diff) | |
download | python-coveragepy-git-dc0e80657257def9203b5e0ca7b6141d3dcd1d57.tar.gz |
fix: combine aliases on windows base dirs (ie: ``X:\``) (fixes: #577)
Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
Diffstat (limited to 'coverage/files.py')
-rw-r--r-- | coverage/files.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/coverage/files.py b/coverage/files.py index 5c2ff1ac..59b2bd61 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -359,17 +359,19 @@ class PathAliases(object): match an entire tree, and not just its root. """ + pattern_sep = sep(pattern) + if len(pattern) > 1: pattern = pattern.rstrip(r"\/") # The pattern can't end with a wildcard component. if pattern.endswith("*"): raise CoverageException("Pattern must not end with wildcards.") - pattern_sep = sep(pattern) # The pattern is meant to match a filepath. Let's make it absolute # unless it already is, or is meant to match any prefix. - if not pattern.startswith('*') and not isabs_anywhere(pattern): + if not pattern.startswith('*') and not isabs_anywhere(pattern + + pattern_sep): pattern = abs_file(pattern) if not pattern.endswith(pattern_sep): pattern += pattern_sep |