Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b6bfce6

Browse files
Issue #26475: Fixed debugging output for regular expressions with the (?x) flag.
2 parents a0d416f + a01a144 commit b6bfce6

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

Lib/sre_parse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -833,14 +833,14 @@ def parse(str, flags=0, pattern=None):
833833
assert source.next == ")"
834834
raise source.error("unbalanced parenthesis")
835835

836-
if flags & SRE_FLAG_DEBUG:
837-
p.dump()
838-
839836
if not (flags & SRE_FLAG_VERBOSE) and p.pattern.flags & SRE_FLAG_VERBOSE:
840837
# the VERBOSE flag was switched on inside the pattern. to be
841838
# on the safe side, we'll parse the whole thing again...
842839
return parse(str, p.pattern.flags)
843840

841+
if flags & SRE_FLAG_DEBUG:
842+
p.dump()
843+
844844
return p
845845

846846
def parse_template(source, pattern):

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ Core and Builtins
201201
Library
202202
-------
203203

204+
- Issue #26475: Fixed debugging output for regular expressions with the (?x)
205+
flag.
206+
204207
- Issue #26482: Allowed pickling recursive dequeues.
205208

206209
- Issue #26335: Make mmap.write() return the number of bytes written like

0 commit comments

Comments
 (0)