Skip to content

Commit

Permalink
Update pywait.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sph3rex authored Feb 23, 2018
1 parent c152334 commit 286c9ca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pywait.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ def valid_connection_spec(connection_spec):

if spec_parts[0] not in valid_protocol_specs:
raise ValueError('Invalid spec. Protocol should any of ' + ' '.join(valid_protocol_specs))

if int(spec_parts[2]) > 65535:
raise ValueError('Invalid port spec.')

spec_port = int(spec_parts[2])
if spec_port > 65535 or spec_port < 1:
raise ValueError('Invalid port spec (greater/lower than allowed).')

return tuple(spec_parts)

Expand Down

0 comments on commit 286c9ca

Please sign in to comment.