Fix ruff error and script (#2680)

This commit is contained in:
Amin Alaee 2023-04-26 09:34:33 +02:00 committed by GitHub
parent 472597fb6b
commit 32e25497a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View 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

View File

@ -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