summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-10-11 17:27:58 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-10-11 17:27:58 (GMT)
commite2adc6c205db6087b3a8f00a245cfb06905b8ae5 (patch)
tree7b137b5d581bd895ba7e2f2a025aa1ea5c61b955 /Modules/socketmodule.c
parentba69936037788ddf0cf43047ecb5c3a00af20628 (diff)
downloadcpython-e2adc6c205db6087b3a8f00a245cfb06905b8ae5.zip
cpython-e2adc6c205db6087b3a8f00a245cfb06905b8ae5.tar.gz
cpython-e2adc6c205db6087b3a8f00a245cfb06905b8ae5.tar.bz2
Use PySocket_Err() instead of PyErr_SetFromErrno().
The former does the right thing on Windows, the latter does not.
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index c492153..56e3700 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -850,7 +850,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);
@@ -2530,8 +2530,7 @@ PySSL_SetError(SSL *ssl, int ret)
/* the underlying BIO reported an I/O error */
Py_DECREF(v);
Py_DECREF(n);
- PyErr_SetFromErrno(PyExc_IOError);
- return NULL;
+ return PySocket_Err();
} else {
/* XXX Protected by global interpreter lock */
errstr = ERR_error_string(e, NULL);