diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2018-09-08 17:19:56 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-09-08 17:19:56 -0400 |
commit | c001d1676de46aef12f80a21675937756e594acf (patch) | |
tree | 7532786607fb9134b406ef48cae21f4a76225d09 /coverage/misc.py | |
parent | 4fe7c61916e9599c459e231245dccc92db2affa8 (diff) | |
download | python-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.py | 2 |
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: |