mirror of https://github.com/python/cpython
In dealloc(), only close the socket if fd != -1.
This commit is contained in:
parent
7aff6f34fe
commit
fa972c987c
|
@ -1356,6 +1356,7 @@ static PyMethodDef PySocketSock_methods[] = {
|
|||
static void
|
||||
BUILD_FUNC_DEF_1(PySocketSock_dealloc,PySocketSockObject *,s)
|
||||
{
|
||||
if (s->sock_fd != -1)
|
||||
(void) close(s->sock_fd);
|
||||
PyMem_DEL(s);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue