Skip to content

Commit

Permalink
Resolve unsoundness caught by pytype --strict-none-binding.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 586331922
  • Loading branch information
Capirca Team committed Nov 29, 2023
1 parent be62241 commit 1051159
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions capirca/lib/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,11 @@ def __str__(self):
# if a srcport or dstport is specified. Fail if src or dst ports are
# specified and of the protocols are not exactly one or both of 'tcp'
# or 'udp'.
if ((not set(protocols).issubset(set(['tcp', 'udp']))) and
(len(src_ports) > 1 or len(dst_ports) > 1)):
if (
(not set(protocols).issubset(set(['tcp', 'udp']))) and
(src_ports is not None and dst_ports is not None) and
(len(src_ports) > 1 or len(dst_ports) > 1)
):
raise aclgenerator.UnsupportedFilterError('%s %s %s' % (
'\n', self.term.name,
'src or dst ports may only be specified with "tcp" and/or "udp".'))
Expand Down

0 comments on commit 1051159

Please sign in to comment.