network: no assert for port number range check
This commit is contained in:
@@ -185,10 +185,9 @@ def deserialize_proxy(s: Optional[str], user: str = None, password: str = None)
|
|||||||
|
|
||||||
def is_valid_port(ps: str):
|
def is_valid_port(ps: str):
|
||||||
try:
|
try:
|
||||||
assert 0 < int(ps) < 65535
|
return 0 < int(ps) < 65535
|
||||||
except (ValueError, AssertionError):
|
except ValueError:
|
||||||
return False
|
return False
|
||||||
return True
|
|
||||||
|
|
||||||
def is_valid_host(ph: str):
|
def is_valid_host(ph: str):
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user