asyncio.CancelledError is a subclass of BaseException since 3.8

This commit is contained in:
Devaev Maxim
2020-03-16 02:32:19 +03:00
parent 5b58af4d6f
commit 966267ebb9
6 changed files with 0 additions and 24 deletions

View File

@@ -397,8 +397,6 @@ class KvmdServer(HttpServer): # pylint: disable=too-many-arguments,too-many-ins
remote: Optional[str] = (ws._req.remote if ws._req is not None else None) # pylint: disable=protected-access
get_logger().info("Removed client socket: remote=%s; id=%d; active=%d", remote, id(ws), len(self.__sockets))
await ws.close()
except asyncio.CancelledError: # pylint: disable=try-except-raise
raise
except Exception:
pass
await self.__streamer_notifier.notify()

View File

@@ -187,8 +187,6 @@ class Streamer: # pylint: disable=too-many-instance-attributes
state = (await response.json())["result"]
except (aiohttp.ClientConnectionError, aiohttp.ServerConnectionError):
pass
except asyncio.CancelledError: # pylint: disable=try-except-raise
raise
except Exception:
get_logger().exception("Invalid streamer response from /state")
return {