cpython: daf3d2a717e5 (original) (raw)

--- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -2450,7 +2450,7 @@ static int internal_connect(PySocketSockObject *s, struct sockaddr *addr, int addrlen, int *timeoutp) {

timeout = 0; @@ -2460,9 +2460,12 @@ internal_connect(PySocketSockObject *s, #ifdef MS_WINDOWS

+

@@ -2481,38 +2484,46 @@ internal_connect(PySocketSockObject *s, Py_END_ALLOW_THREADS if (res == 0) {

+ /* It must be in the exception set */ assert(FD_ISSET(s->sock_fd, &fds_exc));

+

-

#else -

+

timeout = internal_connect_select(s); @@ -2521,27 +2532,31 @@ internal_connect(PySocketSockObject *s, use getsockopt(SO_ERROR) to get the real error. */ socklen_t res_size = sizeof res;

-

#endif *timeoutp = timeout;

} /* s.connect(sockaddr) method */ @@ -2566,6 +2581,13 @@ sock_connect(PySocketSockObject *s, PyOb if (res < 0) return NULL; if (res != 0) { +#ifdef MS_WINDOWS

+#else

+#endif return s->errorhandler(); } Py_INCREF(Py_None);