Commit fa692a82 authored by Denis Bilenko's avatar Denis Bilenko

socket: if socket closed during accept() call in another greenlet, make...

socket: if socket closed during accept() call in another greenlet, make accept() raise socket.error(EBADF)
parent 7aace9f5
......@@ -326,7 +326,8 @@ class socket(object):
if ex[0] != errno.EWOULDBLOCK or self.timeout == 0.0:
raise
sys.exc_clear()
wait_read(self._sock.fileno(), timeout=self.timeout, event=self._read_event)
if not wait_read(self._sock.fileno(), timeout=self.timeout, event=self._read_event):
raise error(errno.EBADF, 'Bad file descriptor')
return socket(_sock=client_socket), address
def close(self):
......
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