Skip to content

Commit c001d16

Browse files
committed
Py2 doesn't like using unmatched groups in regex results
1 parent 4fe7c61 commit c001d16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

coverage/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def substitute_variables(text, variables=os.environ):
271271
def dollar_replace(m):
272272
"""Called for each $replacement."""
273273
# Only one of the groups will have matched, just get its text.
274-
word = m.expand(r"\g<v1>\g<v2>\g<char>")
274+
word = ''.join(m.group(name) or '' for name in ['v1', 'v2', 'char'])
275275
if word == "$":
276276
return "$"
277277
else:

0 commit comments

Comments
 (0)