From a01a144aab05b18b7f4d0e84d04b36b1677338ff Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 6 Mar 2016 09:15:47 +0200 Subject: Issue #26475: Fixed debugging output for regular expressions with the (?x) flag. --- Lib/sre_parse.py | 6 +++--- Misc/NEWS | 3 +++ 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 8044942..fd9a4d6 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -91,6 +91,9 @@ Core and Builtins 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 when resulting prefix length is equal to maximal prefix length. Based on patch by Xiang Zhang. -- cgit v0.12