summaryrefslogtreecommitdiffstats
path: root/Modules/selectmodule.c
diff options
context:
space:
mode:
authorNeil Schemenauer <nascheme@enme.ucalgary.ca>2002-11-18 16:02:29 (GMT)
committerNeil Schemenauer <nascheme@enme.ucalgary.ca>2002-11-18 16:02:29 (GMT)
commit47ec6c079087740eb73c1df0499743e6b931d89f (patch)
tree17480e9928883258c4e1c9f1bbee877a9d4458a2 /Modules/selectmodule.c
parent293fdeb31e664d68d894978c6b85ca97599c1349 (diff)
downloadcpython-47ec6c079087740eb73c1df0499743e6b931d89f.zip
cpython-47ec6c079087740eb73c1df0499743e6b931d89f.tar.gz
cpython-47ec6c079087740eb73c1df0499743e6b931d89f.tar.bz2
Don't use PyNumber_Float() since it's is nearly useless. Instead, rely on
PyFloat_AsDouble to generate a good error message.
Diffstat (limited to 'Modules/selectmodule.c')
-rw-r--r--Modules/selectmodule.c6
1 files 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");