summaryrefslogtreecommitdiff
path: root/coverage/files.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2011-08-21 19:25:07 -0400
committerNed Batchelder <ned@nedbatchelder.com>2011-08-21 19:25:07 -0400
commit8a745e7b1820db4642f45893655207b9ef1acf97 (patch)
treec2883d543f2007f71f13a5a164f6e45bd6fdb25f /coverage/files.py
parent5f6930a60d495c8433b64529ac2ec321d9f1f13b (diff)
downloadpython-coveragepy-8a745e7b1820db4642f45893655207b9ef1acf97.tar.gz
Cleanups for lint and older Pythons
Diffstat (limited to 'coverage/files.py')
-rw-r--r--coverage/files.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/coverage/files.py b/coverage/files.py
index f1046ed..23f1bde 100644
--- a/coverage/files.py
+++ b/coverage/files.py
@@ -162,9 +162,11 @@ class PathAliases(object):
pattern_sep = self._sep(pattern)
pattern += pattern_sep
- # Make a regex from the pattern. fnmatch always adds a \Z to match
- # the whole string, which we don't want.
+ # Make a regex from the pattern. fnmatch always adds a \Z or $ to
+ # match the whole string, which we don't want.
regex_pat = fnmatch.translate(pattern).replace(r'\Z', '')
+ if regex_pat.endswith("$"):
+ regex_pat = regex_pat[:-1]
regex = re.compile("(?i)" + regex_pat)
# Normalize the result: it must end with a path separator.