From: Neil Schemenauer Date: Mon, 18 Nov 2002 16:02:29 +0000 (+0000) Subject: Don't use PyNumber_Float() since it's is nearly useless. Instead, rely on X-Git-Tag: v2.3c1~3375 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=47ec6c079087740eb73c1df0499743e6b931d89f;p=thirdparty%2FPython%2Fcpython.git Don't use PyNumber_Float() since it's is nearly useless. Instead, rely on PyFloat_AsDouble to generate a good error message. --- diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 805dc1a61d1e..0ff0b2cc16a4 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");