Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove unreachable return statements #17622

Merged
merged 2 commits into from
Dec 7, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions superset/utils/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ def is_port_open(host: str, port: int) -> bool:
finally:
s.close()

return False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bycatch: I notice that port is an int in the argument list, but we're recasting it to int on line 33, which is unnecessary. While we're at it, I'd almost recommend removing that cast, and make sure code ever calls this function with anything except an int value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot; I have taken out the int cast - by the looks of it, is_port_open() is only used here, where port is indeed an integer.



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