summaryrefslogtreecommitdiffstats
path: root/Lib/sre_compile.py
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2000-06-30 22:37:31 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2000-06-30 22:37:31 (GMT)
commit55a4f4a528b6eade932b01d7a0bee0a34fae1f6a (patch)
treeca3b29a5036c251fca80910640da0449a5dddfbc /Lib/sre_compile.py
parent361b583e88a260553418aaf5f5b00f31cc5ce5fb (diff)
downloadcpython-55a4f4a528b6eade932b01d7a0bee0a34fae1f6a.zip
cpython-55a4f4a528b6eade932b01d7a0bee0a34fae1f6a.tar.gz
cpython-55a4f4a528b6eade932b01d7a0bee0a34fae1f6a.tar.bz2
- fixed code generation error in multiline mode
- fixed parser flag propagation (of all stupid bugs...)
Diffstat (limited to 'Lib/sre_compile.py')
-rw-r--r--Lib/sre_compile.py4
1 files changed, 2 insertions, 2 deletions
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 @@ 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