chore: Remove unreachable return statements (#17622)

* Remove unreachable return statements

* Remove unnecessary int casting
This commit is contained in:
PApostol 2021-12-07 18:28:35 +00:00 committed by GitHub
parent e660ea2533
commit 9121e4555d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

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