From: Thomas Heller Date: Tue, 24 Sep 2002 17:24:25 +0000 (+0000) Subject: backport of the checkin of revision 2.69 of selectmodule.c X-Git-Tag: v2.2.2b1~122 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b36230bee71b60f39f56728cd08e842d79fc5a83;p=thirdparty%2FPython%2Fcpython.git backport of the checkin of revision 2.69 of selectmodule.c On Windows, call WSAGetLastError() to retrieve the error number. Bugfix candidate, will backport to release22-maint myself. --- diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index ceaf3fa92d20..ec3a8c735552 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -268,9 +268,16 @@ select_select(PyObject *self, PyObject *args) n = select(max, &ifdset, &ofdset, &efdset, tvp); Py_END_ALLOW_THREADS +#ifdef MS_WINDOWS + if (n == SOCKET_ERROR) { + errno = WSAGetLastError(); + PyErr_SetFromErrno(SelectError); + } +#else if (n < 0) { PyErr_SetFromErrno(SelectError); } +#endif else if (n == 0) { /* optimization */ ifdlist = PyList_New(0);