summaryrefslogtreecommitdiff
path: root/Lib/sre_parse.py
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2011-02-25 15:42:01 +0000
committerMarc-André Lemburg <mal@egenix.com>2011-02-25 15:42:01 +0000
commit096c745e602a5c3f2fcf697ab6323422ef4a2f68 (patch)
tree8015a04bfa9d0b7774e7fbf5377bb7082cd92e3c /Lib/sre_parse.py
parentdb738bcdbbd679cacf8be85f9f0f08760ce9e1e5 (diff)
downloadcpython-096c745e602a5c3f2fcf697ab6323422ef4a2f68.tar.gz
Normalize the encoding names for Latin-1 and UTF-8 to
'latin-1' and 'utf-8'. These are optimized in the Python Unicode implementation to result in more direct processing, bypassing the codec registry. Also see issue11303.
Diffstat (limited to 'Lib/sre_parse.py')
-rw-r--r--Lib/sre_parse.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py
index 13737ca12f..ae63c31ebc 100644
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -791,7 +791,7 @@ def parse_template(source, pattern):
else:
# The tokenizer implicitly decodes bytes objects as latin-1, we must
# therefore re-encode the final representation.
- encode = lambda x: x.encode('latin1')
+ encode = lambda x: x.encode('latin-1')
for c, s in p:
if c is MARK:
groupsappend((i, s))