diff options
author | Georg Brandl <georg@python.org> | 2009-06-03 07:25:35 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-06-03 07:25:35 (GMT) |
commit | c1edec3374bb03ca936be3cd0b968140ec58e819 (patch) | |
tree | 4160a66a97eab66e3cc6d533566e8368a9cc9b8f /Doc/tools | |
parent | dad7b7b1cb83d6ead5e8af5c747256a1aaa3f6cf (diff) | |
download | cpython-c1edec3374bb03ca936be3cd0b968140ec58e819.zip cpython-c1edec3374bb03ca936be3cd0b968140ec58e819.tar.gz cpython-c1edec3374bb03ca936be3cd0b968140ec58e819.tar.bz2 |
Use the preferred form of raise statements in the docs.
Diffstat (limited to 'Doc/tools')
-rw-r--r-- | Doc/tools/roman.py | 10 | ||||
-rw-r--r-- | Doc/tools/sphinxext/suspicious.py | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Doc/tools/roman.py b/Doc/tools/roman.py index 33f6db7..89ef617 100644 --- a/Doc/tools/roman.py +++ b/Doc/tools/roman.py @@ -40,9 +40,9 @@ romanNumeralMap = (('M', 1000), def toRoman(n): """convert integer to Roman numeral""" if not (0 < n < 5000): - raise OutOfRangeError, "number out of range (must be 1..4999)" - if int(n) <> n: - raise NotIntegerError, "decimals can not be converted" + raise OutOfRangeError("number out of range (must be 1..4999)") + if int(n) != n: + raise NotIntegerError("decimals can not be converted") result = "" for numeral, integer in romanNumeralMap: @@ -67,9 +67,9 @@ romanNumeralPattern = re.compile(""" def fromRoman(s): """convert Roman numeral to integer""" if not s: - raise InvalidRomanNumeralError, 'Input can not be blank' + raise InvalidRomanNumeralError('Input can not be blank') if not romanNumeralPattern.search(s): - raise InvalidRomanNumeralError, 'Invalid Roman numeral: %s' % s + raise InvalidRomanNumeralError('Invalid Roman numeral: %s' % s) result = 0 index = 0 diff --git a/Doc/tools/sphinxext/suspicious.py b/Doc/tools/sphinxext/suspicious.py index ae11793..37829c3 100644 --- a/Doc/tools/sphinxext/suspicious.py +++ b/Doc/tools/sphinxext/suspicious.py @@ -159,7 +159,7 @@ class CheckSuspiciousMarkupBuilder(Builder): except IOError: return for i, row in enumerate(csv.reader(f)): if len(row) != 4: - raise ValueError, "wrong format in %s, line %d: %s" % (filename, i+1, row) + raise ValueError("wrong format in %s, line %d: %s" % (filename, i+1, row)) docname, lineno, issue, text = row docname = docname.decode('utf-8') if lineno: lineno = int(lineno) |