VirtualMailManager/network.py
branchv0.7.x
changeset 643 df1e3b67882a
parent 568 14abdd04ddf5
child 672 d3fd9bb0a5ea
--- a/VirtualMailManager/network.py	Sun Nov 11 16:53:52 2012 +0000
+++ b/VirtualMailManager/network.py	Tue Nov 20 13:40:32 2012 +0000
@@ -81,7 +81,7 @@
     `(address_family, address_as_long)` will be returned. The
     `address_family`will be either `socket.AF_INET` or `socket.AF_INET6`.
     """
-    if not isinstance(ip_address, basestring) or not ip_address:
+    if not isinstance(ip_address, str) or not ip_address:
         raise TypeError('ip_address must be a non empty string.')
     if not ip_address.count(':'):
         family = socket.AF_INET
@@ -97,4 +97,4 @@
             address = socket.inet_pton(family, ip_address)
         except socket.error:
             raise ValueError('Not a valid IPv6 address: %r' % ip_address)
-    return (family, long(address.encode('hex'), 16))
+    return (family, int(address.encode('hex'), 16))