diff options
author | Collin Winter <collinw@gmail.com> | 2007-08-29 23:37:32 (GMT) |
---|---|---|
committer | Collin Winter <collinw@gmail.com> | 2007-08-29 23:37:32 (GMT) |
commit | 3add4d78ff9f5de02e2c0de09efe9a9b5317539f (patch) | |
tree | c61c6a122b33537814bcc643300f10759fa81010 /Lib/test/test_binop.py | |
parent | e0281cab810c30a23cf2490704e0f85aa4751e83 (diff) | |
download | cpython-3add4d78ff9f5de02e2c0de09efe9a9b5317539f.zip cpython-3add4d78ff9f5de02e2c0de09efe9a9b5317539f.tar.gz cpython-3add4d78ff9f5de02e2c0de09efe9a9b5317539f.tar.bz2 |
Raise statement normalization in Lib/test/.
Diffstat (limited to 'Lib/test/test_binop.py')
-rw-r--r-- | Lib/test/test_binop.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_binop.py b/Lib/test/test_binop.py index 5aeb118..f0433fb 100644 --- a/Lib/test/test_binop.py +++ b/Lib/test/test_binop.py @@ -35,12 +35,12 @@ class Rat(object): The arguments must be ints or longs, and default to (0, 1).""" if not isint(num): - raise TypeError, "Rat numerator must be int or long (%r)" % num + raise TypeError("Rat numerator must be int or long (%r)" % num) if not isint(den): - raise TypeError, "Rat denominator must be int or long (%r)" % den + raise TypeError("Rat denominator must be int or long (%r)" % den) # But the zero is always on if den == 0: - raise ZeroDivisionError, "zero denominator" + raise ZeroDivisionError("zero denominator") g = gcd(den, num) self.__num = int(num//g) self.__den = int(den//g) @@ -73,15 +73,15 @@ class Rat(object): try: return int(self.__num) except OverflowError: - raise OverflowError, ("%s too large to convert to int" % + raise OverflowError("%s too large to convert to int" % repr(self)) - raise ValueError, "can't convert %s to int" % repr(self) + raise ValueError("can't convert %s to int" % repr(self)) def __long__(self): """Convert a Rat to an long; self.den must be 1.""" if self.__den == 1: return int(self.__num) - raise ValueError, "can't convert %s to long" % repr(self) + raise ValueError("can't convert %s to long" % repr(self)) def __add__(self, other): """Add two Rats, or a Rat and a number.""" |