summaryrefslogtreecommitdiffstats
path: root/Objects/floatobject.c
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2008-05-09 13:55:01 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2008-05-09 13:55:01 (GMT)
commitc4352b061a6d6cb35c4364ccfb827ff6c2715553 (patch)
treedc38653d91a3f131707fc020c50fa18900fd9f4c /Objects/floatobject.c
parentb27406c03e662ee33c8d5f48a7478bac93decee8 (diff)
downloadcpython-c4352b061a6d6cb35c4364ccfb827ff6c2715553.zip
cpython-c4352b061a6d6cb35c4364ccfb827ff6c2715553.tar.gz
cpython-c4352b061a6d6cb35c4364ccfb827ff6c2715553.tar.bz2
Issue 2801: fix bug in float.is_integer where ValueError was incorrectly
raised.
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r--Objects/floatobject.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index a748abb..76a5c2c 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -900,6 +900,7 @@ float_is_integer(PyObject *v)
return NULL;
if (!Py_IS_FINITE(x))
Py_RETURN_FALSE;
+ errno = 0;
PyFPE_START_PROTECT("is_integer", return NULL)
o = (floor(x) == x) ? Py_True : Py_False;
PyFPE_END_PROTECT(x)