From 32e25497a36e6222cc64a758c98275b450dac28d Mon Sep 17 00:00:00 2001 From: Amin Alaee Date: Wed, 26 Apr 2023 09:34:33 +0200 Subject: [PATCH] Fix ruff error and script (#2680) --- httpx/_utils.py | 4 ++-- scripts/check | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/httpx/_utils.py b/httpx/_utils.py index 2568fdca1c..a3a045da05 100644 --- a/httpx/_utils.py +++ b/httpx/_utils.py @@ -464,7 +464,7 @@ def __eq__(self, other: typing.Any) -> bool: def is_ipv4_hostname(hostname: str) -> bool: try: ipaddress.IPv4Address(hostname.split("/")[0]) - except: + except Exception: return False return True @@ -472,6 +472,6 @@ def is_ipv4_hostname(hostname: str) -> bool: def is_ipv6_hostname(hostname: str) -> bool: try: ipaddress.IPv6Address(hostname.split("/")[0]) - except: + except Exception: return False return True diff --git a/scripts/check b/scripts/check index 1ac6b99072..3b41a9a8b2 100755 --- a/scripts/check +++ b/scripts/check @@ -11,4 +11,4 @@ set -x ./scripts/sync-version ${PREFIX}black --check --diff --target-version=py37 $SOURCE_FILES ${PREFIX}mypy $SOURCE_FILES -${PREFIX}ruff check --diff $SOURCE_FILES +${PREFIX}ruff check $SOURCE_FILES