Mercurial > cpython-lru_cache-weakref
diff Modules/socketmodule.c @ 12319:57f34e162e67 legacy-trunk
In dealloc(), only close the socket if fd != -1.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 10 Apr 2000 12:45:45 +0000 |
| parents | 7859c0a4ad95 |
| children | dff7b26116de |
line wrap: on
line diff
--- a/Modules/socketmodule.c Mon Apr 10 01:31:58 2000 +0000 +++ b/Modules/socketmodule.c Mon Apr 10 12:45:45 2000 +0000 @@ -1356,7 +1356,8 @@ static void BUILD_FUNC_DEF_1(PySocketSock_dealloc,PySocketSockObject *,s) { - (void) close(s->sock_fd); + if (s->sock_fd != -1) + (void) close(s->sock_fd); PyMem_DEL(s); }
