From 5d0fdbc690744dd48a9476d1b362b2bbcf773e88 Mon Sep 17 00:00:00 2001 From: Anthony Baxter Date: Thu, 1 Nov 2001 13:58:16 +0000 Subject: [PATCH] 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. --- Modules/socketmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.3