[Python-checkins] python/dist/src/Modules selectmodule.c,2.71,2.72
nascheme@projects.sourceforge.net
nascheme@projects.sourceforge.net
Mon, 18 Nov 2002 08:02:42 -0800
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv18671/Modules
Modified Files:
selectmodule.c
Log Message:
Don't use PyNumber_Float() since it's is nearly useless. Instead, rely on
PyFloat_AsDouble to generate a good error message.
Index: selectmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/selectmodule.c,v
retrieving revision 2.71
retrieving revision 2.72
diff -C2 -d -r2.71 -r2.72
*** selectmodule.c 12 Nov 2002 11:42:20 -0000 2.71
--- selectmodule.c 18 Nov 2002 16:02:29 -0000 2.72
***************
*** 215,223 ****
}
else {
! tout = PyNumber_Float(tout);
! if (!tout)
return NULL;
- timeout = PyFloat_AS_DOUBLE(tout);
- Py_DECREF(tout);
if (timeout > (double)LONG_MAX) {
PyErr_SetString(PyExc_OverflowError,
--- 215,221 ----
}
else {
! timeout = PyFloat_AsDouble(tout);
! if (timeout == -1 && PyErr_Occurred())
return NULL;
if (timeout > (double)LONG_MAX) {
PyErr_SetString(PyExc_OverflowError,