summaryrefslogtreecommitdiff
path: root/coverage
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
commit6b00eb851344fd4c733b51d6402d36ea4158471d (patch)
tree7f7d62e946996ac5e602da2ea69c1092b92c3e6a /coverage
parentba69be6407e27201e7c6b54bc9eaa53e1d97bb5b (diff)
downloadpython-coveragepy-git-6b00eb851344fd4c733b51d6402d36ea4158471d.tar.gz
Cleanups for lint and older Pythons
Diffstat (limited to 'coverage')
-rw-r--r--coverage/data.py3
-rw-r--r--coverage/files.py6
2 files changed, 5 insertions, 4 deletions
diff --git a/coverage/data.py b/coverage/data.py
index 1cc4c950..1d6799f0 100644
--- a/coverage/data.py
+++ b/coverage/data.py
@@ -1,10 +1,9 @@
"""Coverage data for Coverage."""
-import fnmatch, os, re
+import os
from coverage.backward import pickle, sorted # pylint: disable=W0622
from coverage.files import PathAliases
-from coverage.misc import CoverageException
class CoverageData(object):
diff --git a/coverage/files.py b/coverage/files.py
index f1046ed1..23f1bdef 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.