Ticket #42698: patch-cymru-__init__.py.diff

File patch-cymru-__init__.py.diff, 482 bytes (added by jul_bsd@…, 11 years ago)
  • cymru/__init__.py

    old new  
    1919        return IPy.IP(ip).strCompressed()
    2020
    2121except ImportError as e:
    22     import ipaddress # sucks for reverse.
     22    try:
     23        ## python >= 3
     24        import ipaddress # sucks for reverse.
     25    except ImportError:
     26        import ipaddr as ipaddress
    2327    def ip_reverse(ip):
    2428        ip = ipaddress.ip_address(ip)
    2529        if ip.version == 4: