Commit c32410ae authored by Tim Peters's avatar Tim Peters

PySocketSock_connect_ex(): On Windows, return the correct Windows exit

code.  The patch is from Jeremy, and allows test_asynchat to run again.
Bugfix candidate.
parent 4ecd7137
......@@ -1267,8 +1267,13 @@ PySocketSock_connect_ex(PySocketSockObject *s, PyObject *addro)
Py_BEGIN_ALLOW_THREADS
res = connect(s->sock_fd, addr, addrlen);
Py_END_ALLOW_THREADS
if (res != 0)
if (res != 0) {
#ifdef MS_WINDOWS
res = WSAGetLastError();
#else
res = errno;
#endif
}
return PyInt_FromLong((long) res);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment