mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
Recompile pattern if (?x) flag was found inside the pattern during the
first scan. Closes bug #115040.
This commit is contained in:
parent
4ae8ef84da
commit
d11b5e54f0
2 changed files with 9 additions and 2 deletions
|
@ -593,6 +593,11 @@ def parse(str, flags=0, pattern=None):
|
|||
|
||||
# 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)
|
||||
|
||||
return p
|
||||
|
||||
def parse_template(source, pattern):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue