- fixed code generation error in multiline mode
- fixed parser flag propagation (of all stupid bugs...)
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index 6c7e588..590e45f 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -118,7 +118,7 @@
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 @@
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