From 47ec6c079087740eb73c1df0499743e6b931d89f Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Mon, 18 Nov 2002 16:02:29 +0000 Subject: Don't use PyNumber_Float() since it's is nearly useless. Instead, rely on PyFloat_AsDouble to generate a good error message. --- Modules/selectmodule.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 805dc1a..0ff0b2c 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"); -- cgit v0.12