Fix mypy not catching non-nullability of conn

This commit is contained in:
Luna 2020-04-01 20:01:44 -03:00
parent 133154ad1b
commit 6a74a7f990
1 changed files with 4 additions and 4 deletions

View File

@ -185,11 +185,11 @@ class LVSPConnection:
"""Start the websocket.""" """Start the websocket."""
await self.start() await self.start()
try: if self.conn is None:
if self.conn is None: log.error("failed to start lvsp connection, stopping")
log.error("failed to start lvsp connection, stopping") return
return
try:
await self._loop() await self._loop()
except websockets.exceptions.ConnectionClosed as err: except websockets.exceptions.ConnectionClosed as err:
log.warning("conn close, {}, err={}", self._log_id, err) log.warning("conn close, {}, err={}", self._log_id, err)