]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Fix ruff error and script (#2680)
authorAmin Alaee <mohammadamin.alaee@gmail.com>
Wed, 26 Apr 2023 07:34:33 +0000 (09:34 +0200)
committerGitHub <noreply@github.com>
Wed, 26 Apr 2023 07:34:33 +0000 (09:34 +0200)
httpx/_utils.py
scripts/check

index 2568fdca1c63af632829d0f5ac18a1b8ff0e3ab6..a3a045da05601811bdea1bba67b6705f53f4ffe4 100644 (file)
@@ -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
index 1ac6b99072c64110a603cf8d2947bc4967208ddb..3b41a9a8b261017e5d39637c663217af8bdd7ba6 100755 (executable)
@@ -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