From: Anthony Baxter Date: Thu, 1 Nov 2001 13:58:16 +0000 (+0000) Subject: backport (partially) jeremy's 1.178 X-Git-Tag: v2.1.2c1~92 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5d0fdbc690744dd48a9476d1b362b2bbcf773e88;p=thirdparty%2FPython%2Fcpython.git backport (partially) jeremy's 1.178 Use PySocket_Err() instead of PyErr_SetFromErrno(). The former does the right thing on Windows, the latter does not. The 'partial' is because the code's changed quite a lot and it's not clear that the two that are still there of the form return PyErr_SetFromErrno(SSLErrorObject); can be replaced with PySocket_Err() - it looks like they need the new PySSL_SetError, which is a tad large to be comfortable with just checking in without reading it further. --- diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 3c55b4cf122c..c2e38804e81f 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -707,7 +707,7 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args, strncpy(ifr.ifr_name, interfaceName, sizeof(ifr.ifr_name)); ifr.ifr_name[(sizeof(ifr.ifr_name))-1] = '\0'; if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) { - PyErr_SetFromErrno(PySocket_Error); + PySocket_Err(); return 0; } addr = &(s->sock_addr.ll);