[issue14613] time.time can return None or NaN
STINNER Victor
report at bugs.python.org
Wed Apr 18 14:58:08 CEST 2012
STINNER Victor <victor.stinner at gmail.com> added the comment:
> time.time() can return None, or sometimes NaN
It is possible that it returns NaN, but it cannot return None. time.time() implementation of Python 2.7:
static PyObject *
time_time(PyObject *self, PyObject *unused)
{
double secs;
secs = floattime();
if (secs == 0.0) {
PyErr_SetFromErrno(PyExc_IOError);
return NULL;
}
return PyFloat_FromDouble(secs);
}
FYI I removed the (secs == 0.0) check in Python 3.3 (issue #14368, changeset 206c45f45236), it was a bug. time.time() *cannot* fail, it always return a float.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14613>
_______________________________________
More information about the Python-bugs-list
mailing list