summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-04 00:37:34 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-01-04 00:37:34 (GMT)
commit8267d1dfe5f73007812dcb35f865fd4763e94471 (patch)
treee90dcb5c1de29d750dba16d57d359ad5cf160378 /Lib
parent0613188bc3ad62b96d5dae879814d0e8563d955c (diff)
downloadcpython-8267d1dfe5f73007812dcb35f865fd4763e94471.zip
cpython-8267d1dfe5f73007812dcb35f865fd4763e94471.tar.gz
cpython-8267d1dfe5f73007812dcb35f865fd4763e94471.tar.bz2
Bug #1481296: Fixed long(float('nan'))!=0L.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_long.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py
index 29515c7..d745350 100644
--- a/Lib/test/test_long.py
+++ b/Lib/test/test_long.py
@@ -498,6 +498,10 @@ class LongTest(unittest.TestCase):
eq(x > y, Rcmp > 0, Frm("%r > %r %d", x, y, Rcmp))
eq(x >= y, Rcmp >= 0, Frm("%r >= %r %d", x, y, Rcmp))
+ def test_nan_inf(self):
+ self.assertRaises(OverflowError, long, float('inf'))
+ self.assertEqual(long(float('nan')), 0L)
+
def test_main():
test_support.run_unittest(LongTest)