Fix ruff error and script (#2680)
This commit is contained in:
parent
472597fb6b
commit
32e25497a3
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user