mirror of
https://github.com/python/cpython.git
synced 2025-10-05 06:31:48 +00:00
socket.close() was modified in Python 3.6 to raise OSError on
failure: see bpo-26685.
(cherry picked from commit 67e1478dba
)
This commit is contained in:
parent
23e2c3d193
commit
580cd5cd36
2 changed files with 4 additions and 1 deletions
|
@ -2704,7 +2704,9 @@ sock_close(PySocketSockObject *s)
|
|||
Py_BEGIN_ALLOW_THREADS
|
||||
res = SOCKETCLOSE(fd);
|
||||
Py_END_ALLOW_THREADS
|
||||
if (res < 0) {
|
||||
/* bpo-30319: The peer can already have closed the connection.
|
||||
Python ignores ECONNRESET on close(). */
|
||||
if (res < 0 && errno != ECONNRESET) {
|
||||
return s->errorhandler();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue