From d9e2e3c7eb62f59109101370fee4e157c8af3052 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 2 Oct 2022 17:42:11 -0400 Subject: refactor: remove minor pre-3.7 complexity --- coverage/files.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'coverage/files.py') 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 -- cgit v1.2.1