diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2008-05-09 16:14:15 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2008-05-09 16:14:15 (GMT) |
commit | e81c3760807215a65a69c20701631ee0b8ad774b (patch) | |
tree | ca831b75c2baf8d6bd7b69d4675c039bd4f93b8c /Objects/floatobject.c | |
parent | 17433d206c1a705c8dad9a52d33c5546dc069e42 (diff) | |
download | cpython-e81c3760807215a65a69c20701631ee0b8ad774b.zip cpython-e81c3760807215a65a69c20701631ee0b8ad774b.tar.gz cpython-e81c3760807215a65a69c20701631ee0b8ad774b.tar.bz2 |
Issue #2801: fix bug in float.is_integer where ValueError
could be incorrectly raised. This is a backport of the
Py3k fix in r62939. (Should really have been fixed
in the trunk first and svnmerged into py3k.)
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r-- | Objects/floatobject.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c index f79995c..ceb0b6d 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -1031,6 +1031,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) |