forked from M-Labs/thermostat
More elegant exception rethrow
This commit is contained in:
parent
b83cef24c7
commit
a8121984e2
@ -38,8 +38,8 @@ class Client:
|
|||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
try:
|
try:
|
||||||
self._reader, self._writer = await self._connecting_task
|
self._reader, self._writer = await self._connecting_task
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError as exc:
|
||||||
raise StoppedConnecting
|
raise StoppedConnecting from exc
|
||||||
finally:
|
finally:
|
||||||
self._connecting_task = None
|
self._connecting_task = None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user