Skip to content

Commit 5c93c59

Browse files
authored
Preserve exception context in Client.connect (#1450)
1 parent 6a52e8b commit 5c93c59

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/socketio/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ async def connect(self, url, headers={}, auth=None, transports=None,
158158
await self._handle_reconnect()
159159
if self.eio.state == 'connected':
160160
return
161-
raise exceptions.ConnectionError(exc.args[0]) from None
161+
raise exceptions.ConnectionError(exc.args[0]) from exc
162162

163163
if wait:
164164
try:

src/socketio/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def connect(self, url, headers={}, auth=None, transports=None,
156156
self._handle_reconnect()
157157
if self.eio.state == 'connected':
158158
return
159-
raise exceptions.ConnectionError(exc.args[0]) from None
159+
raise exceptions.ConnectionError(exc.args[0]) from exc
160160

161161
if wait:
162162
while self._connect_event.wait(timeout=wait_timeout):

0 commit comments

Comments
 (0)