Commit 8b8b2600 authored by Matthias Klose's avatar Matthias Klose

Tools/unicode/mkstringprep.py: Don't use string exceptions,

partial backport from r78982.
parent 1b939643
import re, unicodedata, sys import re, unicodedata, sys
if sys.maxunicode == 65535: if sys.maxunicode == 65535:
raise RuntimeError, "need UCS-4 Python" raise RuntimeError("need UCS-4 Python")
def gen_category(cats): def gen_category(cats):
for i in range(0, 0x110000): for i in range(0, 0x110000):
...@@ -63,14 +63,14 @@ for l in data: ...@@ -63,14 +63,14 @@ for l in data:
if m: if m:
if m.group(1) == "Start": if m.group(1) == "Start":
if curname: if curname:
raise "Double Start",(curname, l) raise RuntimeError("Double Start", (curname, l))
curname = m.group(2) curname = m.group(2)
table = {} table = {}
tables.append((curname, table)) tables.append((curname, table))
continue continue
else: else:
if not curname: if not curname:
raise "End without start", l raise RuntimeError("End without start", l)
curname = None curname = None
continue continue
if not curname: if not curname:
......
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