diff options
author | Marc Abramowitz <marc@marc-abramowitz.com> | 2014-04-03 15:45:55 -0700 |
---|---|---|
committer | Marc Abramowitz <marc@marc-abramowitz.com> | 2014-04-03 15:45:55 -0700 |
commit | 0a032a760d0c784aaf0e7ca0593dfeaf6cb0f577 (patch) | |
tree | f63b2d0da6b13824792abd92b38d100fa717d9c5 /tox | |
parent | 0db675a8de9e80db8abeeae8d2390f341acce1f1 (diff) | |
download | tox-git-0a032a760d0c784aaf0e7ca0593dfeaf6cb0f577.tar.gz |
Allow backslashing curly braces to prevent expansion
e.g.: commands=echo \{posargs\} = {posargs}
--HG--
branch : allow_backslash_escape_curly_braces_msabramo_2
Diffstat (limited to 'tox')
-rw-r--r-- | tox/_config.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tox/_config.py b/tox/_config.py index 6006fa94..4d54924b 100644 --- a/tox/_config.py +++ b/tox/_config.py @@ -451,8 +451,8 @@ class IndexServerConfig: self.url = url RE_ITEM_REF = re.compile( - ''' - [{] + r''' + (?<!\\)[{] (?:(?P<sub_type>[^[:{}]+):)? # optional sub_type for special rules (?P<substitution_value>[^{}]*) # substitution key [}] @@ -686,7 +686,7 @@ class CommandParser(object): def word_has_ended(): return ((cur_char in string.whitespace and ps.word and ps.word[-1] not in string.whitespace) or - (cur_char == '{' and ps.depth == 0) or + (cur_char == '{' and ps.depth == 0 and not ps.word.endswith('\\')) or (ps.depth == 0 and ps.word and ps.word[-1] == '}') or (cur_char not in string.whitespace and ps.word and ps.word.strip() == '')) |