From 102b0253f97eaccd86d25edd2e06e56d3408e382 Mon Sep 17 00:00:00 2001 From: Capirca Team Date: Wed, 29 Nov 2023 07:31:04 -0800 Subject: [PATCH] Resolve unsoundness caught by pytype --strict-none-binding. PiperOrigin-RevId: 586336266 --- capirca/lib/port.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/capirca/lib/port.py b/capirca/lib/port.py index 39e8384c..a7f51c38 100644 --- a/capirca/lib/port.py +++ b/capirca/lib/port.py @@ -79,7 +79,7 @@ def is_single_port(self): @property def start(self): # return the first port in the range as int - if '-' in self.port: + if self.port is not None and '-' in self.port: self._start = int(self.port.split('-')[0]) else: raise InvalidRange('%s is not a valid port range' % self.port) @@ -88,7 +88,7 @@ def start(self): @property def end(self): # return the last port in the range as int - if '-' in self.port: + if self.port is not None and '-' in self.port: self._end = int(self.port.split('-')[1]) else: raise InvalidRange('%s is not a valid port range' % self.port)