Kaydet (Commit) 08481462 authored tarafından Guido van Rossum's avatar Guido van Rossum

Don't close an already closed socket.

üst 9b058119
......@@ -610,9 +610,11 @@ BUILD_FUNC_DEF_2(PySocketSock_close,PySocketSockObject *,s, PyObject *,args)
{
if (!PyArg_NoArgs(args))
return NULL;
Py_BEGIN_ALLOW_THREADS
(void) close(s->sock_fd);
Py_END_ALLOW_THREADS
if (s->sock_fd != -1) {
Py_BEGIN_ALLOW_THREADS
(void) close(s->sock_fd);
Py_END_ALLOW_THREADS
}
s->sock_fd = -1;
Py_INCREF(Py_None);
return Py_None;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment