diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2017-10-12 21:45:47 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2017-10-12 21:45:47 -0400 |
commit | 3ae1989ac0f79b0f2b2d6e4192ae2fa94dc5d73e (patch) | |
tree | 366e0421a43268faaa23438c7f101e6541164a55 /coverage/files.py | |
parent | 6931d2ecd71da60cb8e06f4b1011dacdea74f28f (diff) | |
download | python-coveragepy-3ae1989ac0f79b0f2b2d6e4192ae2fa94dc5d73e.tar.gz |
Avoid a deprecation warning (from https://github.com/nedbat/coveragepy/pull/33)
Diffstat (limited to 'coverage/files.py')
-rw-r--r-- | coverage/files.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/coverage/files.py b/coverage/files.py index d573f22..346043d 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -260,12 +260,11 @@ class FnmatchMatcher(object): # Python3.7 fnmatch translates "/" as "/", before that, it translates as "\/", # so we have to deal with maybe a backslash. fnpats = (re.sub(r"\\?/", r"[\\\\/]", p) for p in fnpats) + flags = 0 if env.WINDOWS: - # Windows is also case-insensitive. BTW: the regex docs say that - # flags like (?i) have to be at the beginning, but fnmatch puts - # them at the end, and having two there seems to work fine. - fnpats = (p + "(?i)" for p in fnpats) - self.re = re.compile(join_regex(fnpats)) + # Windows is also case-insensitive, so make the regex case-insensitive. + flags |= re.IGNORECASE + self.re = re.compile(join_regex(fnpats), flags=flags) def __repr__(self): return "<FnmatchMatcher %r>" % self.pats |