diff --git a/setup.py b/setup.py index 346cb60..7e7a587 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ setup(name="magic-wormhole", "autobahn[twisted] >= 0.14.1", "hkdf", "tqdm", ], - extras_require={"tor": ["txtorcon", "ipaddr"]}, + extras_require={"tor": ["txtorcon", "ipaddress"]}, test_suite="wormhole.test", cmdclass=commands, ) diff --git a/src/wormhole/tor_manager.py b/src/wormhole/tor_manager.py index 4e96284..97cc2e9 100644 --- a/src/wormhole/tor_manager.py +++ b/src/wormhole/tor_manager.py @@ -3,7 +3,7 @@ import time from twisted.internet.defer import inlineCallbacks, returnValue from twisted.internet.error import ConnectError import txtorcon -import ipaddr +import ipaddress from .timing import DebugTiming from .transit import allocate_tcp_port @@ -112,7 +112,7 @@ class TorManager: # for numeric hostnames, skip RFC1918 addresses, since no Tor exit # node will be able to reach those. Likewise ignore IPv6 addresses. try: - a = ipaddr.IPAddress(host) + a = ipaddress.ip_address(host) except ValueError: return False # non-numeric, let Tor try it if a.version != 4: