VirtualMailManager/network.py
branchv0.7.x
changeset 672 d3fd9bb0a5ea
parent 643 df1e3b67882a
child 676 2bc11dada296
--- a/VirtualMailManager/network.py	Sun Dec 30 18:13:56 2012 +0000
+++ b/VirtualMailManager/network.py	Sat Jan 05 18:23:05 2013 +0000
@@ -10,6 +10,8 @@
 
 import socket
 
+from binascii import b2a_hex
+
 
 class NetInfo(object):
     """Simple class for CIDR network addresses an IP addresses."""
@@ -97,4 +99,4 @@
             address = socket.inet_pton(family, ip_address)
         except socket.error:
             raise ValueError('Not a valid IPv6 address: %r' % ip_address)
-    return (family, int(address.encode('hex'), 16))
+    return (family, int(b2a_hex(address), 16))