mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
- fixed code generation error in multiline mode
- fixed parser flag propagation (of all stupid bugs...)
This commit is contained in:
parent
361b583e88
commit
55a4f4a528
2 changed files with 8 additions and 7 deletions
|
@ -118,7 +118,7 @@ def _compile(code, pattern, flags):
|
|||
elif op is AT:
|
||||
emit(OPCODES[op])
|
||||
if flags & SRE_FLAG_MULTILINE:
|
||||
emit(ATCODES[AT_MULTILINE[av]])
|
||||
emit(ATCODES[AT_MULTILINE.get(av, av)])
|
||||
else:
|
||||
emit(ATCODES[av])
|
||||
elif op is BRANCH:
|
||||
|
@ -203,7 +203,7 @@ def compile(p, flags=0):
|
|||
if type(p) in (type(""), type(u"")):
|
||||
import sre_parse
|
||||
pattern = p
|
||||
p = sre_parse.parse(p)
|
||||
p = sre_parse.parse(p, flags)
|
||||
else:
|
||||
pattern = None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue