Commit 47ec6c07 authored by Neil Schemenauer's avatar Neil Schemenauer

Don't use PyNumber_Float() since it's is nearly useless. Instead, rely on

PyFloat_AsDouble to generate a good error message.
parent 293fdeb3
......@@ -214,11 +214,9 @@ select_select(PyObject *self, PyObject *args)
return NULL;
}
else {
tout = PyNumber_Float(tout);
if (!tout)
timeout = PyFloat_AsDouble(tout);
if (timeout == -1 && PyErr_Occurred())
return NULL;
timeout = PyFloat_AS_DOUBLE(tout);
Py_DECREF(tout);
if (timeout > (double)LONG_MAX) {
PyErr_SetString(PyExc_OverflowError,
"timeout period too long");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment