Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /Modules/selectmodule.c [dc3166] .. [97424b] Maximize Restore

  Switch to side-by-side view

--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -39,7 +39,7 @@
 #endif
 
 #ifdef MS_WINDOWS
-#include <winsock.h>
+#include <windows.h>
 #else
 #ifdef __BEOS__
 #include <net/socket.h>
@@ -273,9 +273,15 @@
 	n = select(max, &ifdset, &ofdset, &efdset, tvp);
 	Py_END_ALLOW_THREADS
 
+#ifdef MS_WINDOWS
+	if (n == SOCKET_ERROR) {
+		PyErr_SetExcFromWindowsErr(SelectError, WSAGetLastError());
+	}
+#else
 	if (n < 0) {
 		PyErr_SetFromErrno(SelectError);
 	}
+#endif
 	else if (n == 0) {
                 /* optimization */
 		ifdlist = PyList_New(0);