Loading kodo_sso/util/network.py +10 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,16 @@ del _GLOBALS # Configure for the best backend if ipaddress: net_factory = ipaddress.ip_network addr_factory = ipaddress.ip_address def net_factory(network): """Return an ipaddress.ip_network which takes a unicode argument""" if isinstance(network, bytes): network = network.decode() return ipaddress.ip_network(network) def addr_factory(address): """Return an ipaddress.ip_address which takes a unicode argument""" if isinstance(address, bytes): address = address.decode() return ipaddress.ip_address(address) elif netaddr: net_factory = netaddr.IPNetwork addr_factory = netaddr.IPAddress Loading Loading
kodo_sso/util/network.py +10 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,16 @@ del _GLOBALS # Configure for the best backend if ipaddress: net_factory = ipaddress.ip_network addr_factory = ipaddress.ip_address def net_factory(network): """Return an ipaddress.ip_network which takes a unicode argument""" if isinstance(network, bytes): network = network.decode() return ipaddress.ip_network(network) def addr_factory(address): """Return an ipaddress.ip_address which takes a unicode argument""" if isinstance(address, bytes): address = address.decode() return ipaddress.ip_address(address) elif netaddr: net_factory = netaddr.IPNetwork addr_factory = netaddr.IPAddress Loading