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

PyFloat_AsDouble to generate a good error message.
This commit is contained in:
Neil Schemenauer 2002-11-18 16:02:29 +00:00
parent 293fdeb31e
commit 47ec6c0790
1 changed files with 2 additions and 4 deletions

View File

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