Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/sre_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# XXX: show string offset and offending character for all errors

from sre_constants import *
import unicodedata

SPECIAL_CHARS = ".\\[{()*+?^$|"
REPEAT_CHARS = "*+?{"
Expand Down Expand Up @@ -324,6 +323,7 @@ def _class_escape(source, escape):
chr(c) # raise ValueError for invalid code
return LITERAL, c
elif c == "N" and source.istext:
import unicodedata
# named unicode escape e.g. \N{EM DASH}
if not source.match('{'):
raise source.error("missing {")
Expand Down Expand Up @@ -383,6 +383,7 @@ def _escape(source, escape, state):
chr(c) # raise ValueError for invalid code
return LITERAL, c
elif c == "N" and source.istext:
import unicodedata
# named unicode escape e.g. \N{EM DASH}
if not source.match('{'):
raise source.error("missing {")
Expand Down