Skip to content

Commit

Permalink
chore: Remove unreachable return statements (#17622)
Browse files Browse the repository at this point in the history
* Remove unreachable return statements

* Remove unnecessary int casting
  • Loading branch information
PApostol authored Dec 7, 2021
1 parent e660ea2 commit 9121e45
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions superset/utils/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ 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:
return False
finally:
s.close()

return False


def is_hostname_valid(host: str) -> bool:
"""
Expand All @@ -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:
"""
Expand Down

0 comments on commit 9121e45

Please sign in to comment.