Fix SF bug# 676155, RuntimeWarning with tp_compare

Check return value of PyLong_AsDouble(), it can return an error.
This commit is contained in:
Neal Norwitz 2003-01-28 19:21:24 +00:00
parent 54fb192508
commit abcb0c03ad
4 changed files with 13 additions and 3 deletions

View file

@ -186,6 +186,7 @@ class BuiltinTest(unittest.TestCase):
def __coerce__(self, other):
raise ValueError
self.assertRaises(ValueError, coerce, 42, BadNumber())
self.assertRaises(OverflowError, coerce, 0.5, int("12345" * 1000))
def test_compile(self):
compile('print 1\n', '', 'exec')