diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-10-02 17:42:11 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-10-02 17:42:11 -0400 |
commit | d9e2e3c7eb62f59109101370fee4e157c8af3052 (patch) | |
tree | befc09aed0cd979e4e507e6be38a8b5fa2ce05ea /coverage/files.py | |
parent | 08712e99bbfff973cca786aab04875b79c4e0fba (diff) | |
download | python-coveragepy-git-d9e2e3c7eb62f59109101370fee4e157c8af3052.tar.gz |
refactor: remove minor pre-3.7 complexity
Diffstat (limited to 'coverage/files.py')
-rw-r--r-- | coverage/files.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/coverage/files.py b/coverage/files.py index 4d0c1a2b..4475f2f1 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -296,9 +296,8 @@ def fnmatches_to_regex(patterns, case_insensitive=False, partial=False): """ regexes = (fnmatch.translate(pattern) for pattern in patterns) - # Python3.7 fnmatch translates "/" as "/". Before that, it translates as "\/", - # so we have to deal with maybe a backslash. - regexes = (re.sub(r"\\?/", r"[\\\\/]", regex) for regex in regexes) + # Be agnostic: / can mean backslash or slash. + regexes = (re.sub(r"/", r"[\\\\/]", regex) for regex in regexes) if partial: # fnmatch always adds a \Z to match the whole string, which we don't |