summaryrefslogtreecommitdiffstats
path: root/Lib/sre_parse.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-03-06 07:15:47 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-03-06 07:15:47 (GMT)
commita61bfdbecd923a596771a0af5a93cbf17203e23a (patch)
tree8513bc063b5e6f4407c0a6468d54bd5f6397f949 /Lib/sre_parse.py
parent7c033e60dfc6b90015978ee62ac11a3316e80026 (diff)
downloadcpython-a61bfdbecd923a596771a0af5a93cbf17203e23a.zip
cpython-a61bfdbecd923a596771a0af5a93cbf17203e23a.tar.gz
cpython-a61bfdbecd923a596771a0af5a93cbf17203e23a.tar.bz2
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.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py
index c29cc16..75f488b 100644
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -721,14 +721,14 @@ def parse(str, flags=0, pattern=None):
elif tail:
raise error, "bogus characters at end of regular expression"
- 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):