diff options
author | 2016-03-06 09:15:47 +0200 | |
---|---|---|
committer | 2016-03-06 09:15:47 +0200 | |
commit | a01a144aab05b18b7f4d0e84d04b36b1677338ff (patch) | |
tree | 3bdbb563160d1f252b87bbe0003c642d780762d7 /Lib/sre_parse.py | |
parent | Fixed typo in pickle tests. (diff) | |
download | cpython-a01a144aab05b18b7f4d0e84d04b36b1677338ff.tar.gz cpython-a01a144aab05b18b7f4d0e84d04b36b1677338ff.tar.bz2 cpython-a01a144aab05b18b7f4d0e84d04b36b1677338ff.zip |
Issue #26475: Fixed debugging output for regular expressions with the (?x) flag.
Diffstat (limited to 'Lib/sre_parse.py')
-rw-r--r-- | Lib/sre_parse.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py index f6a88517dfc..4ff50d1006a 100644 --- a/Lib/sre_parse.py +++ b/Lib/sre_parse.py @@ -833,14 +833,14 @@ def parse(str, flags=0, pattern=None): assert source.next == ")" raise source.error("unbalanced parenthesis") - if flags & SRE_FLAG_DEBUG: - p.dump() - if not (flags & SRE_FLAG_VERBOSE) and p.pattern.flags & SRE_FLAG_VERBOSE: # the VERBOSE flag was switched on inside the pattern. to be # on the safe side, we'll parse the whole thing again... return parse(str, p.pattern.flags) + if flags & SRE_FLAG_DEBUG: + p.dump() + return p def parse_template(source, pattern): |