summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-02-06 23:08:00 (GMT)
committerGeorg Brandl <georg@python.org>2010-02-06 23:08:00 (GMT)
commitdf8a303dff544588c86c6aa2f95b8c16d2b6e951 (patch)
treee71a2a56267f94bc8c81c885bec8c5de96f4dad0 /Lib/test
parent8fd107f8eae5e9a7ecc2a164bd6b8bcb24c9b48e (diff)
downloadcpython-df8a303dff544588c86c6aa2f95b8c16d2b6e951.zip
cpython-df8a303dff544588c86c6aa2f95b8c16d2b6e951.tar.gz
cpython-df8a303dff544588c86c6aa2f95b8c16d2b6e951.tar.bz2
Fix a few UnboundLocalErrors in test_long.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_long.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py
index 494014e..5c20dfe 100644
--- a/Lib/test/test_long.py
+++ b/Lib/test/test_long.py
@@ -536,7 +536,7 @@ class LongTest(unittest.TestCase):
except OverflowError:
self.fail("int(long(sys.maxint)) overflowed!")
if not isinstance(x, int):
- raise TestFailed("int(long(sys.maxint)) should have returned int")
+ self.fail("int(long(sys.maxint)) should have returned int")
x = int(hugeneg_aslong)
try:
self.assertEqual(x, hugeneg,
@@ -544,8 +544,7 @@ class LongTest(unittest.TestCase):
except OverflowError:
self.fail("int(long(-sys.maxint-1)) overflowed!")
if not isinstance(x, int):
- raise TestFailed("int(long(-sys.maxint-1)) should have "
- "returned int")
+ self.fail("int(long(-sys.maxint-1)) should have returned int")
# but long -> int should overflow for hugepos+1 and hugeneg-1
x = hugepos_aslong + 1
try:
@@ -803,7 +802,7 @@ class LongTest(unittest.TestCase):
self.d = d
assert float(n) / float(d) == value
else:
- raise TypeError("can't deal with %r" % val)
+ raise TypeError("can't deal with %r" % value)
def __cmp__(self, other):
if not isinstance(other, Rat):