chore: Remove unreachable return statements (#17622)
* Remove unreachable return statements * Remove unnecessary int casting
This commit is contained in:
parent
e660ea2533
commit
9121e4555d
|
|
@ -30,7 +30,7 @@ def is_port_open(host: str, port: int) -> bool:
|
|||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.settimeout(PORT_TIMEOUT)
|
||||
try:
|
||||
s.connect((host, int(port)))
|
||||
s.connect((host, port))
|
||||
s.shutdown(socket.SHUT_RDWR)
|
||||
return True
|
||||
except socket.error:
|
||||
|
|
@ -38,8 +38,6 @@ def is_port_open(host: str, port: int) -> bool:
|
|||
finally:
|
||||
s.close()
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def is_hostname_valid(host: str) -> bool:
|
||||
"""
|
||||
|
|
@ -51,8 +49,6 @@ def is_hostname_valid(host: str) -> bool:
|
|||
except socket.gaierror:
|
||||
return False
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def is_host_up(host: str) -> bool:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue