diff options
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index a1d829f9cb..e18dd32d90 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -2696,7 +2696,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(); } } |