mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix SF bug# 676155, RuntimeWarning with tp_compare
Check return value of PyLong_AsDouble(), it can return an error.
This commit is contained in:
parent
54fb192508
commit
abcb0c03ad
4 changed files with 13 additions and 3 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue