fix assert

This commit is contained in:
Connor Olding 2021-06-27 17:06:41 +02:00
parent 848d5791ed
commit d24831a233

View File

@ -23,7 +23,7 @@ def read_ips(f):
def addr_to_int(ip):
match = ipv4_pattern.fullmatch(ip)
assert match is not None, row
assert match is not None, ip
segs = list(map(int, match.group(1, 2, 3, 4)))
assert all(0 <= seg <= 255 for seg in segs), match.group(0)
numeric = segs[0] << 24 | segs[1] << 16 | segs[2] << 8 | segs[3]