Commit a67eabb8 authored by Stefan Behnel's avatar Stefan Behnel

add error test case for unknown \N{...} Unicode escape name

parent 2a9d8d45
...@@ -815,7 +815,8 @@ def p_string_literal(s, kind_override=None): ...@@ -815,7 +815,8 @@ def p_string_literal(s, kind_override=None):
try: try:
chrval = ord(unicodedata.lookup(systr[3:-1])) chrval = ord(unicodedata.lookup(systr[3:-1]))
except KeyError: except KeyError:
s.error("Unknown Unicode character name %r" % systr[3:-1]) s.error("Unknown Unicode character name %s" %
repr(systr[3:-1]).lstrip('u'))
elif len(systr) in (6,10): elif len(systr) in (6,10):
chrval = int(systr[2:], 16) chrval = int(systr[2:], 16)
if chrval > 1114111: # sys.maxunicode: if chrval > 1114111: # sys.maxunicode:
......
# mode: error
u'\N{GIBBET NICH}'
_ERRORS = '''
3:2: Unknown Unicode character name 'GIBBET NICH'
'''
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment