From 3e133ab1ef4b1fc31266b5b3e56690d94d4e2d9a Mon Sep 17 00:00:00 2001 From: Egbert Bouman Date: Thu, 15 Aug 2024 15:02:18 +0200 Subject: [PATCH] Catch ClientConnectorError in _is_url_available --- .ruff.toml | 1 + src/tribler/core/session.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.ruff.toml b/.ruff.toml index 0b513515eb..f695d22b1e 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -8,6 +8,7 @@ lint.ignore = [ "ARG001", "ARG002", "ARG005", + "ASYNC109", "BLE001", "COM812", "COM819", diff --git a/src/tribler/core/session.py b/src/tribler/core/session.py index 8b94cba5f0..c0cbd8d971 100644 --- a/src/tribler/core/session.py +++ b/src/tribler/core/session.py @@ -81,7 +81,7 @@ async def _is_url_available(url: str, timeout: int=1) -> bool: try: async with session.get(url, timeout=timeout): return True - except asyncio.TimeoutError: + except (asyncio.TimeoutError, aiohttp.client_exceptions.ClientConnectorError): return False