summaryrefslogtreecommitdiff
path: root/coverage/misc.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-09-08 17:19:56 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-09-08 17:19:56 -0400
commitc001d1676de46aef12f80a21675937756e594acf (patch)
tree7532786607fb9134b406ef48cae21f4a76225d09 /coverage/misc.py
parent4fe7c61916e9599c459e231245dccc92db2affa8 (diff)
downloadpython-coveragepy-git-c001d1676de46aef12f80a21675937756e594acf.tar.gz
Py2 doesn't like using unmatched groups in regex results
Diffstat (limited to 'coverage/misc.py')
-rw-r--r--coverage/misc.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/coverage/misc.py b/coverage/misc.py
index c6a7c8cf..037332f5 100644
--- a/coverage/misc.py
+++ b/coverage/misc.py
@@ -271,7 +271,7 @@ def substitute_variables(text, variables=os.environ):
def dollar_replace(m):
"""Called for each $replacement."""
# Only one of the groups will have matched, just get its text.
- word = m.expand(r"\g<v1>\g<v2>\g<char>")
+ word = ''.join(m.group(name) or '' for name in ['v1', 'v2', 'char'])
if word == "$":
return "$"
else: