use ipaddress not ipaddr

This commit is contained in:
meejah 2016-06-02 11:16:04 -07:00
parent 7b0ca28589
commit 5b23669cf3
2 changed files with 3 additions and 3 deletions

View File

@ -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,
)

View File

@ -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: