forked from M-Labs/thermostat
More elegant exception rethrow
This commit is contained in:
parent
757fd1689a
commit
f76b414426
@ -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