Commit 2bebc893 authored by Jérome Perrin's avatar Jérome Perrin Committed by Jérome Perrin

util: cleanup

( original issue was that sys was no imported, but it's better to raise
a catchable exception than to exit program )
parent 3fae274a
......@@ -125,7 +125,7 @@ def ipv6FromBin(ip, suffix=''):
if suffix_len > 0:
ip += suffix.rjust(suffix_len, '0')
elif suffix_len:
sys.exit("Prefix exceeds 128 bits")
raise ValueError("Prefix exceeds 128 bits")
return socket.inet_ntop(socket.AF_INET6,
struct.pack('>QQ', int(ip[:64], 2), int(ip[64:], 2)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment