Commit 35462e9d authored by Denis Bilenko's avatar Denis Bilenko

make gevent.http 2.4-compatible

- and don't silent KeyboardInterrupt in serve_forever()
parent 5ce1abfa
...@@ -68,6 +68,7 @@ class HTTPServer(object): ...@@ -68,6 +68,7 @@ class HTTPServer(object):
if self._done_event is None: if self._done_event is None:
self._done_event = Event() self._done_event = Event()
t = Timeout.start_new(timeout) t = Timeout.start_new(timeout)
try:
try: try:
self._done_event.wait(timeout=timeout) self._done_event.wait(timeout=timeout)
except Timeout, ex: except Timeout, ex:
...@@ -141,8 +142,6 @@ class HTTPServer(object): ...@@ -141,8 +142,6 @@ class HTTPServer(object):
if self._serve_forever_event is None: if self._serve_forever_event is None:
self._serve_forever_event = Event() self._serve_forever_event = Event()
self._serve_forever_event.wait() self._serve_forever_event.wait()
except KeyboardInterrupt:
pass
finally: finally:
Greenlet.spawn(self.stop, timeout=stop_timeout).join() Greenlet.spawn(self.stop, timeout=stop_timeout).join()
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