From 286c9ca0b599734ccf0544be41631aca2be55d79 Mon Sep 17 00:00:00 2001 From: sph3rex Date: Fri, 23 Feb 2018 15:46:31 +0200 Subject: [PATCH] Update pywait.py --- pywait.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pywait.py b/pywait.py index c5c67c2..5cd02ad 100644 --- a/pywait.py +++ b/pywait.py @@ -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)