summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Modules/selectmodule.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 805dc1a61d..0ff0b2cc16 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -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");