From: Serhiy Storchaka Date: Sun, 6 Mar 2016 07:15:47 +0000 (+0200) Subject: Issue #26475: Fixed debugging output for regular expressions with the (?x) flag. X-Git-Tag: v2.7.12rc1~199 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a61bfdbecd923a596771a0af5a93cbf17203e23a;p=thirdparty%2FPython%2Fcpython.git Issue #26475: Fixed debugging output for regular expressions with the (?x) flag. --- diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py index c29cc1685cb6..75f488b54750 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): diff --git a/Misc/NEWS b/Misc/NEWS index 51220c3275f5..5308a1239a36 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -55,6 +55,9 @@ Core and Builtins Library ------- +- Issue #26475: Fixed debugging output for regular expressions with the (?x) + flag. + - Issue #26385: Remove the file if the internal fdopen() call in NamedTemporaryFile() fails. Based on patch by Silent Ghost.