]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport (partially) jeremy's 1.178
authorAnthony Baxter <anthonybaxter@gmail.com>
Thu, 1 Nov 2001 13:58:16 +0000 (13:58 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Thu, 1 Nov 2001 13:58:16 +0000 (13:58 +0000)
  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.

Modules/socketmodule.c

index 3c55b4cf122cbe6835e0ead20d3a827cff3e07c3..c2e38804e81f0d1c21ce3015012b4fe9e68afd72 100644 (file)
@@ -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);