Issue 2801: fix bug in float.is_integer where ValueError was incorrectly

raised.
This commit is contained in:
Mark Dickinson 2008-05-09 13:55:01 +00:00
parent b27406c03e
commit c4352b061a
2 changed files with 4 additions and 0 deletions

View file

@ -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)