summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_long.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2003-01-28 19:21:24 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2003-01-28 19:21:24 (GMT)
commitabcb0c03ade3cee52b71362f57b16af3e00c743b (patch)
treea4afc16116d2e0d08a0ea162932cb635b550bde0 /Lib/test/test_long.py
parent54fb192508130fa17df5b252c63d125218907035 (diff)
downloadcpython-abcb0c03ade3cee52b71362f57b16af3e00c743b.zip
cpython-abcb0c03ade3cee52b71362f57b16af3e00c743b.tar.gz
cpython-abcb0c03ade3cee52b71362f57b16af3e00c743b.tar.bz2
Fix SF bug# 676155, RuntimeWarning with tp_compare
Check return value of PyLong_AsDouble(), it can return an error.
Diffstat (limited to 'Lib/test/test_long.py')
-rw-r--r--Lib/test/test_long.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py
index 9cab2de..9eb063c 100644
--- a/Lib/test/test_long.py
+++ b/Lib/test/test_long.py
@@ -371,9 +371,10 @@ def test_float_overflow():
for x in -2.0, -1.0, 0.0, 1.0, 2.0:
verify(float(long(x)) == x)
+ shuge = '12345' * 1000
huge = 1L << 30000
mhuge = -huge
- namespace = {'huge': huge, 'mhuge': mhuge, 'math': math}
+ namespace = {'huge': huge, 'mhuge': mhuge, 'shuge': shuge, 'math': math}
for test in ["float(huge)", "float(mhuge)",
"complex(huge)", "complex(mhuge)",
"complex(huge, 1)", "complex(mhuge, 1)",
@@ -386,7 +387,8 @@ def test_float_overflow():
"1. ** huge", "huge ** 1.", "1. ** mhuge", "mhuge ** 1.",
"math.sin(huge)", "math.sin(mhuge)",
"math.sqrt(huge)", "math.sqrt(mhuge)", # should do better
- "math.floor(huge)", "math.floor(mhuge)"]:
+ "math.floor(huge)", "math.floor(mhuge)",
+ "float(shuge) == int(shuge)"]:
try:
eval(test, namespace)