From f75d60a63f9b5e99481231ea9b2b956616278327 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 8 Jul 2022 12:08:54 -0400 Subject: style: use new regex match object group access --- coverage/files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'coverage/files.py') diff --git a/coverage/files.py b/coverage/files.py index 09f09da7..507496ff 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -270,7 +270,7 @@ def sep(s): """Find the path separator used in this string, or os.sep if none.""" sep_match = re.search(r"[\\/]", s) if sep_match: - the_sep = sep_match.group(0) + the_sep = sep_match[0] else: the_sep = os.sep return the_sep @@ -387,7 +387,7 @@ class PathAliases: for regex, result in self.aliases: m = regex.match(path) if m: - new = path.replace(m.group(0), result) + new = path.replace(m[0], result) new = new.replace(sep(path), sep(result)) if not self.relative: new = canonical_filename(new) -- cgit v1.2.1