changeset: 100421:37cdbe0a16a4 parent: 100417:be993678d4f7 parent: 100419:910d0256601f user: Serhiy Storchaka date: Sun Mar 06 09:17:39 2016 +0200 files: Misc/NEWS description: Issue #26475: Fixed debugging output for regular expressions with the (?x) flag. diff -r be993678d4f7 -r 37cdbe0a16a4 Lib/sre_parse.py --- a/Lib/sre_parse.py Sun Mar 06 08:55:21 2016 +0200 +++ b/Lib/sre_parse.py Sun Mar 06 09:17:39 2016 +0200 @@ -833,14 +833,14 @@ 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 -r be993678d4f7 -r 37cdbe0a16a4 Misc/NEWS --- a/Misc/NEWS Sun Mar 06 08:55:21 2016 +0200 +++ b/Misc/NEWS Sun Mar 06 09:17:39 2016 +0200 @@ -201,6 +201,9 @@ 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