1
0

changed some asserts to raise-exceptions in lib

This commit is contained in:
SomberNight
2018-04-07 17:01:38 +02:00
parent cf88e239d7
commit 76e67daadd
5 changed files with 34 additions and 15 deletions

View File

@@ -140,7 +140,8 @@ def deserialize_proxy(s):
def deserialize_server(server_str):
host, port, protocol = str(server_str).rsplit(':', 2)
assert protocol in 'st'
if protocol not in 'st':
raise ValueError('invalid network protocol: {}'.format(protocol))
int(port) # Throw if cannot be converted to int
return host, port, protocol