diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-03-06 14:08:44 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-03-06 14:08:44 (GMT) |
commit | f050648a505b3810b659ca490c2e418a02c702cc (patch) | |
tree | c517105ffc9b5bcfcadf13d626cf795d6b4b533e /Lib/test/test_float.py | |
parent | 8c51fedcdffcdca46eb7420325cf69c1da2d30be (diff) | |
download | cpython-f050648a505b3810b659ca490c2e418a02c702cc.zip cpython-f050648a505b3810b659ca490c2e418a02c702cc.tar.gz cpython-f050648a505b3810b659ca490c2e418a02c702cc.tar.bz2 |
fix potential refleak in PyFloat_AsDouble (closes #23590)
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r-- | Lib/test/test_float.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index e6779c4..5bf1d31 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -8,6 +8,7 @@ import operator import random import fractions import sys +import time INF = float("inf") NAN = float("nan") @@ -164,6 +165,11 @@ class GeneralFloatCases(unittest.TestCase): self.assertAlmostEqual(float(FooUnicode('8')), 9.) self.assertAlmostEqual(float(FooStr('8')), 9.) + class Foo5: + def __float__(self): + return "" + self.assertRaises(TypeError, time.sleep, Foo5()) + def test_is_integer(self): self.assertFalse((1.1).is_integer()) self.assertTrue((1.).is_integer()) |