summaryrefslogtreecommitdiffstats
path: root/Tools/unicode
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-08-22 23:05:06 (GMT)
committerCollin Winter <collinw@gmail.com>2007-08-22 23:05:06 (GMT)
commita817e5894b20d68263056bf9af8f1582954b1d8f (patch)
tree2409955c53ffb88f6934f277d66c4fe44011e601 /Tools/unicode
parent2d7f6a079df2b4582d7ccc32a7a2a7287d0bf175 (diff)
downloadcpython-a817e5894b20d68263056bf9af8f1582954b1d8f.zip
cpython-a817e5894b20d68263056bf9af8f1582954b1d8f.tar.gz
cpython-a817e5894b20d68263056bf9af8f1582954b1d8f.tar.bz2
Convert raise statements in Tools/.
Diffstat (limited to 'Tools/unicode')
-rw-r--r--Tools/unicode/makeunicodedata.py8
-rw-r--r--Tools/unicode/mkstringprep.py2
2 files changed, 5 insertions, 5 deletions
diff --git a/Tools/unicode/makeunicodedata.py b/Tools/unicode/makeunicodedata.py
index ab08887..3778efa 100644
--- a/Tools/unicode/makeunicodedata.py
+++ b/Tools/unicode/makeunicodedata.py
@@ -138,7 +138,7 @@ def makeunicodedata(unicode, trace):
if record[5]:
decomp = record[5].split()
if len(decomp) > 19:
- raise Exception, "character %x has a decomposition too large for nfd_nfkd" % char
+ raise Exception("character %x has a decomposition too large for nfd_nfkd" % char)
# prefix
if decomp[0][0] == "<":
prefix = decomp.pop(0)
@@ -608,7 +608,7 @@ def makeunicodename(unicode, trace):
def merge_old_version(version, new, old):
# Changes to exclusion file not implemented yet
if old.exclusions != new.exclusions:
- raise NotImplementedError, "exclusions differ"
+ raise NotImplementedError("exclusions differ")
# In these change records, 0xFF means "no change"
bidir_changes = [0xFF]*0x110000
@@ -677,7 +677,7 @@ def merge_old_version(version, new, old):
pass
else:
class Difference(Exception):pass
- raise Difference, (hex(i), k, old.table[i], new.table[i])
+ raise Difference(hex(i), k, old.table[i], new.table[i])
new.changed.append((version, list(zip(bidir_changes, category_changes,
decimal_changes, numeric_changes)),
normalization_changes))
@@ -821,7 +821,7 @@ class Hash:
poly = size + poly
break
else:
- raise AssertionError, "ran out of polynominals"
+ raise AssertionError("ran out of polynominals")
print(size, "slots in hash table")
diff --git a/Tools/unicode/mkstringprep.py b/Tools/unicode/mkstringprep.py
index b910d69..83a5d8f 100644
--- a/Tools/unicode/mkstringprep.py
+++ b/Tools/unicode/mkstringprep.py
@@ -1,7 +1,7 @@
import re, unicodedata, sys
if sys.maxunicode == 65535:
- raise RuntimeError, "need UCS-4 Python"
+ raise RuntimeError("need UCS-4 Python")
def gen_category(cats):
for i in range(0, 0x110000):