From 64b2271f77003ea4c22eace305641d82c29daada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B3=96=E9=9C=B2=E6=98=9F=E9=9C=9C=E2=80=A2=E6=9A=96?= =?UTF-8?q?=E9=9C=9E=E6=8B=BE=E5=85=89?= <2468001320@qq.com> Date: Thu, 13 Aug 2026 03:38:10 +0800 Subject: [PATCH] fix: replace bare except with except Exception in gmaps/utils helpers --- ghunt/helpers/gmaps.py | 2 +- ghunt/helpers/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ghunt/helpers/gmaps.py b/ghunt/helpers/gmaps.py index 4a34e3a8..7a215c36 100644 --- a/ghunt/helpers/gmaps.py +++ b/ghunt/helpers/gmaps.py @@ -289,7 +289,7 @@ def calculate_probable_location(geolocator: Nominatim, reviews_and_photos: List[ try: location = geolocator.reverse(f"{avg[0]}, {avg[1]}", timeout=10).raw["address"] break - except: + except Exception: pass location = sanitize_location(location) locs[nb]["avg"] = location diff --git a/ghunt/helpers/utils.py b/ghunt/helpers/utils.py index ce03d60b..cd43f1e7 100644 --- a/ghunt/helpers/utils.py +++ b/ghunt/helpers/utils.py @@ -54,7 +54,7 @@ def is_headers_syntax_good(headers: Dict[str, str]) -> bool: try: httpx.Headers(headers) return True - except: + except Exception: return False async def get_url_image_flathash(as_client: httpx.AsyncClient, image_url: str) -> str: