From f31295ef30be63ab48766958320207af1f6dde5d Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 11 Jun 2019 10:06:35 -0400 Subject: Polishing substitute_variables --- coverage/misc.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'coverage/misc.py') diff --git a/coverage/misc.py b/coverage/misc.py index e34bc000..d87a7b89 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -260,7 +260,7 @@ def substitute_variables(text, variables=os.environ): strict = bool(m.group('strict')) if strict: if word not in variables: - msg = "Variable {} is undefined: {}".format(word, text) + msg = "Variable {} is undefined: {!r}".format(word, text) raise CoverageException(msg) return variables.get(word, m.group('defval') or '') @@ -271,8 +271,7 @@ def substitute_variables(text, variables=os.environ): { # or a {-wrapped word, (?P\w+) (?: - (?P\?) # with a strict marker - | + (?P\?) | # with a strict marker -(?P[^}]*) # or a default value )? } -- cgit v1.2.1