summaryrefslogtreecommitdiff
path: root/coverage/files.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-07-08 12:08:54 -0400
committerNed Batchelder <ned@nedbatchelder.com>2022-07-08 12:08:54 -0400
commitf75d60a63f9b5e99481231ea9b2b956616278327 (patch)
treecf6762c8b801fbb25dea8177f9b8774f735e1546 /coverage/files.py
parent8447c995e822ca63836037290d045f0fd6d53fb5 (diff)
downloadpython-coveragepy-git-f75d60a63f9b5e99481231ea9b2b956616278327.tar.gz
style: use new regex match object group access
Diffstat (limited to 'coverage/files.py')
-rw-r--r--coverage/files.py4
1 files changed, 2 insertions, 2 deletions
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)