summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_richcmp.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-08-29 23:37:32 (GMT)
committerCollin Winter <collinw@gmail.com>2007-08-29 23:37:32 (GMT)
commit3add4d78ff9f5de02e2c0de09efe9a9b5317539f (patch)
treec61c6a122b33537814bcc643300f10759fa81010 /Lib/test/test_richcmp.py
parente0281cab810c30a23cf2490704e0f85aa4751e83 (diff)
downloadcpython-3add4d78ff9f5de02e2c0de09efe9a9b5317539f.zip
cpython-3add4d78ff9f5de02e2c0de09efe9a9b5317539f.tar.gz
cpython-3add4d78ff9f5de02e2c0de09efe9a9b5317539f.tar.bz2
Raise statement normalization in Lib/test/.
Diffstat (limited to 'Lib/test/test_richcmp.py')
-rw-r--r--Lib/test/test_richcmp.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/test/test_richcmp.py b/Lib/test/test_richcmp.py
index 180440e..efe6923 100644
--- a/Lib/test/test_richcmp.py
+++ b/Lib/test/test_richcmp.py
@@ -29,7 +29,7 @@ class Number:
return self.x >= other
def __cmp__(self, other):
- raise test_support.TestFailed, "Number.__cmp__() should not be called"
+ raise test_support.TestFailed("Number.__cmp__() should not be called")
def __repr__(self):
return "Number(%r)" % (self.x, )
@@ -49,13 +49,13 @@ class Vector:
self.data[i] = v
def __hash__(self):
- raise TypeError, "Vectors cannot be hashed"
+ raise TypeError("Vectors cannot be hashed")
def __bool__(self):
- raise TypeError, "Vectors cannot be used in Boolean contexts"
+ raise TypeError("Vectors cannot be used in Boolean contexts")
def __cmp__(self, other):
- raise test_support.TestFailed, "Vector.__cmp__() should not be called"
+ raise test_support.TestFailed("Vector.__cmp__() should not be called")
def __repr__(self):
return "Vector(%r)" % (self.data, )
@@ -82,7 +82,7 @@ class Vector:
if isinstance(other, Vector):
other = other.data
if len(self.data) != len(other):
- raise ValueError, "Cannot compare vectors of different length"
+ raise ValueError("Cannot compare vectors of different length")
return other
opmap = {
@@ -196,10 +196,10 @@ class MiscTest(unittest.TestCase):
def __lt__(self, other): return 0
def __gt__(self, other): return 0
def __eq__(self, other): return 0
- def __le__(self, other): raise TestFailed, "This shouldn't happen"
- def __ge__(self, other): raise TestFailed, "This shouldn't happen"
- def __ne__(self, other): raise TestFailed, "This shouldn't happen"
- def __cmp__(self, other): raise RuntimeError, "expected"
+ def __le__(self, other): raise TestFailed("This shouldn't happen")
+ def __ge__(self, other): raise TestFailed("This shouldn't happen")
+ def __ne__(self, other): raise TestFailed("This shouldn't happen")
+ def __cmp__(self, other): raise RuntimeError("expected")
a = Misb()
b = Misb()
self.assertEqual(a<b, 0)