diff --git a/engineio/asyncio_socket.py b/engineio/asyncio_socket.py index 84163c61..718f4cb8 100644 --- a/engineio/asyncio_socket.py +++ b/engineio/asyncio_socket.py @@ -1,5 +1,6 @@ import asyncio import six +import sys import time from . import exceptions @@ -76,8 +77,9 @@ async def handle_get_request(self, environ): try: packets = await self.poll() except exceptions.QueueEmpty: + exc = sys.exc_info() await self.close(wait=False) - raise + six.reraise(*exc) return packets async def handle_post_request(self, environ): diff --git a/engineio/socket.py b/engineio/socket.py index dd983a7e..d4ffa67c 100644 --- a/engineio/socket.py +++ b/engineio/socket.py @@ -1,4 +1,5 @@ import six +import sys import time from . import exceptions @@ -91,8 +92,9 @@ def handle_get_request(self, environ, start_response): try: packets = self.poll() except exceptions.QueueEmpty: + exc = sys.exc_info() self.close(wait=False) - raise + six.reraise(*exc) return packets def handle_post_request(self, environ):