mirror of
https://github.com/python/cpython.git
synced 2025-09-28 03:13:48 +00:00
Use PySocket_Err() instead of PyErr_SetFromErrno().
The former does the right thing on Windows, the latter does not.
This commit is contained in:
parent
ba69936037
commit
e2adc6c205
1 changed files with 2 additions and 3 deletions
|
@ -850,7 +850,7 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
|
||||||
strncpy(ifr.ifr_name, interfaceName, sizeof(ifr.ifr_name));
|
strncpy(ifr.ifr_name, interfaceName, sizeof(ifr.ifr_name));
|
||||||
ifr.ifr_name[(sizeof(ifr.ifr_name))-1] = '\0';
|
ifr.ifr_name[(sizeof(ifr.ifr_name))-1] = '\0';
|
||||||
if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) {
|
if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) {
|
||||||
PyErr_SetFromErrno(PySocket_Error);
|
PySocket_Err();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
addr = &(s->sock_addr.ll);
|
addr = &(s->sock_addr.ll);
|
||||||
|
@ -2530,8 +2530,7 @@ PySSL_SetError(SSL *ssl, int ret)
|
||||||
/* the underlying BIO reported an I/O error */
|
/* the underlying BIO reported an I/O error */
|
||||||
Py_DECREF(v);
|
Py_DECREF(v);
|
||||||
Py_DECREF(n);
|
Py_DECREF(n);
|
||||||
PyErr_SetFromErrno(PyExc_IOError);
|
return PySocket_Err();
|
||||||
return NULL;
|
|
||||||
} else {
|
} else {
|
||||||
/* XXX Protected by global interpreter lock */
|
/* XXX Protected by global interpreter lock */
|
||||||
errstr = ERR_error_string(e, NULL);
|
errstr = ERR_error_string(e, NULL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue