summaryrefslogtreecommitdiff
path: root/Lib/sre_constants.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-05-05 08:53:40 +0300
committerGitHub <noreply@github.com>2017-05-05 08:53:40 +0300
commit898ff03e1e7925ecde3da66327d3cdc7e07625ba (patch)
tree977fc4b98c0e85816348cebd3b12026407c368b6 /Lib/sre_constants.py
parent647c3d381e67490e82cdbbe6c96e46d5e1628ce2 (diff)
downloadcpython-git-898ff03e1e7925ecde3da66327d3cdc7e07625ba.tar.gz
bpo-30215: Make re.compile() locale agnostic. (#1361)
Compiled regular expression objects with the re.LOCALE flag no longer depend on the locale at compile time. Only the locale at matching time affects the result of matching.
Diffstat (limited to 'Lib/sre_constants.py')
-rw-r--r--Lib/sre_constants.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/sre_constants.py b/Lib/sre_constants.py
index fc684ae96f..b0164312d0 100644
--- a/Lib/sre_constants.py
+++ b/Lib/sre_constants.py
@@ -13,7 +13,7 @@
# update when constants are added or removed
-MAGIC = 20140917
+MAGIC = 20170530
from _sre import MAXREPEAT, MAXGROUPS
@@ -87,6 +87,9 @@ OPCODES = _makecodes("""
SUBPATTERN
MIN_REPEAT_ONE
RANGE_IGNORE
+ LITERAL_LOC_IGNORE
+ NOT_LITERAL_LOC_IGNORE
+ IN_LOC_IGNORE
MIN_REPEAT MAX_REPEAT
""")
@@ -124,6 +127,11 @@ OP_IGNORE = {
RANGE: RANGE_IGNORE,
}
+OP_LOC_IGNORE = {
+ LITERAL: LITERAL_LOC_IGNORE,
+ NOT_LITERAL: NOT_LITERAL_LOC_IGNORE,
+}
+
AT_MULTILINE = {
AT_BEGINNING: AT_BEGINNING_LINE,
AT_END: AT_END_LINE