Commit a01a144a authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #26475: Fixed debugging output for regular expressions with the (?x) flag.

parent be700028
...@@ -833,14 +833,14 @@ def parse(str, flags=0, pattern=None): ...@@ -833,14 +833,14 @@ def parse(str, flags=0, pattern=None):
assert source.next == ")" assert source.next == ")"
raise source.error("unbalanced parenthesis") 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: if not (flags & SRE_FLAG_VERBOSE) and p.pattern.flags & SRE_FLAG_VERBOSE:
# the VERBOSE flag was switched on inside the pattern. to be # the VERBOSE flag was switched on inside the pattern. to be
# on the safe side, we'll parse the whole thing again... # on the safe side, we'll parse the whole thing again...
return parse(str, p.pattern.flags) return parse(str, p.pattern.flags)
if flags & SRE_FLAG_DEBUG:
p.dump()
return p return p
def parse_template(source, pattern): def parse_template(source, pattern):
......
...@@ -91,6 +91,9 @@ Core and Builtins ...@@ -91,6 +91,9 @@ Core and Builtins
Library Library
------- -------
- Issue #26475: Fixed debugging output for regular expressions with the (?x)
flag.
- Issue #26457: Fixed the subnets() methods in IP network classes for the case - Issue #26457: Fixed the subnets() methods in IP network classes for the case
when resulting prefix length is equal to maximal prefix length. when resulting prefix length is equal to maximal prefix length.
Based on patch by Xiang Zhang. Based on patch by Xiang Zhang.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment