summaryrefslogtreecommitdiffstats
path: root/Lib/sre_compile.py
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2000-06-30 00:27:46 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2000-06-30 00:27:46 (GMT)
commit01016fe972a90eb57bafeb1f4a73f334c201c3c2 (patch)
tree14f34bb2cea2e9f688fba020dfd00adb8c8aaa96 /Lib/sre_compile.py
parent5d6ae76c0925b9f0fce059f5372f633532535b67 (diff)
downloadcpython-01016fe972a90eb57bafeb1f4a73f334c201c3c2.zip
cpython-01016fe972a90eb57bafeb1f4a73f334c201c3c2.tar.gz
cpython-01016fe972a90eb57bafeb1f4a73f334c201c3c2.tar.bz2
- fixed split behaviour on empty matches
- fixed compiler problems when using locale/unicode flags - fixed group/octal code parsing in sub/subn templates
Diffstat (limited to 'Lib/sre_compile.py')
-rw-r--r--Lib/sre_compile.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index 344dc29..ea5f5bc 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -61,9 +61,9 @@ def _compile(code, pattern, flags):
elif op is CATEGORY:
emit(OPCODES[op])
if flags & SRE_FLAG_LOCALE:
- emit(CH_LOCALE[CHCODES[av]])
+ emit(CHCODES[CH_LOCALE[av]])
elif flags & SRE_FLAG_UNICODE:
- emit(CH_UNICODE[CHCODES[av]])
+ emit(CHCODES[CH_UNICODE[av]])
else:
emit(CHCODES[av])
elif op is GROUP:
@@ -92,9 +92,9 @@ def _compile(code, pattern, flags):
emit(fixup(av[1]))
elif op is CATEGORY:
if flags & SRE_FLAG_LOCALE:
- emit(CH_LOCALE[CHCODES[av]])
+ emit(CHCODES[CH_LOCALE[av]])
elif flags & SRE_FLAG_UNICODE:
- emit(CH_UNICODE[CHCODES[av]])
+ emit(CHCODES[CH_UNICODE[av]])
else:
emit(CHCODES[av])
else: