summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-03-06 07:17:39 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-03-06 07:17:39 (GMT)
commitb6bfce6c0b4721700241b550e31ae3aeabcb6f41 (patch)
tree955e90154c76d73e36d9b63571e418e265d4d4c2
parenta0d416f0d186b5ee6ea6a898418871157a55b4f6 (diff)
parenta01a144aab05b18b7f4d0e84d04b36b1677338ff (diff)
downloadcpython-b6bfce6c0b4721700241b550e31ae3aeabcb6f41.zip
cpython-b6bfce6c0b4721700241b550e31ae3aeabcb6f41.tar.gz
cpython-b6bfce6c0b4721700241b550e31ae3aeabcb6f41.tar.bz2
Issue #26475: Fixed debugging output for regular expressions with the (?x) flag.
-rw-r--r--Lib/sre_parse.py6
-rw-r--r--Misc/NEWS3
2 files changed, 6 insertions, 3 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py
index f6a8851..4ff50d1 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):
diff --git a/Misc/NEWS b/Misc/NEWS
index 4ce8bf6..8cae4f4 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -201,6 +201,9 @@ Core and Builtins
Library
-------
+- Issue #26475: Fixed debugging output for regular expressions with the (?x)
+ flag.
+
- Issue #26482: Allowed pickling recursive dequeues.
- Issue #26335: Make mmap.write() return the number of bytes written like