From: Amin Alaee Date: Wed, 26 Apr 2023 07:34:33 +0000 (+0200) Subject: Fix ruff error and script (#2680) X-Git-Tag: 0.24.1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32e25497a36e6222cc64a758c98275b450dac28d;p=thirdparty%2Fhttpx.git Fix ruff error and script (#2680) --- diff --git a/httpx/_utils.py b/httpx/_utils.py index 2568fdca..a3a045da 100644 --- a/httpx/_utils.py +++ b/httpx/_utils.py @@ -464,7 +464,7 @@ class URLPattern: 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 1ac6b990..3b41a9a8 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