Commit ad0aa9a6 authored by Denis Bilenko's avatar Denis Bilenko

server: use EWOULDBLOCK, not EAGAIN. Patch by Alexey Borzenkov.

This fixes a lot of stacktraces of socket.error on Windows where EAGAIN != EWOULDBLOCK
parent 072e221a
...@@ -5,6 +5,7 @@ import errno ...@@ -5,6 +5,7 @@ import errno
from gevent import socket from gevent import socket
from gevent.baseserver import BaseServer from gevent.baseserver import BaseServer
from gevent.hub import get_hub from gevent.hub import get_hub
from gevent.socket import EWOULDBLOCK
__all__ = ['StreamServer'] __all__ = ['StreamServer']
...@@ -115,7 +116,7 @@ class StreamServer(BaseServer): ...@@ -115,7 +116,7 @@ class StreamServer(BaseServer):
try: try:
client_socket, address = self.socket.accept() client_socket, address = self.socket.accept()
except socket.error, err: except socket.error, err:
if err[0] == errno.EAGAIN: if err[0] == EWOULDBLOCK:
return return
raise raise
self.delay = self.min_delay self.delay = self.min_delay
......
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