Also work without SRV records

This commit is contained in:
Florent Le Coz 2014-11-05 01:11:44 +01:00
parent ad8c76602b
commit 68e35e631a

View file

@ -128,6 +128,9 @@ def resolve(host, port=None, service=None, proto='tcp',
hosts = yield from get_SRV(host, port, service, proto, hosts = yield from get_SRV(host, port, service, proto,
resolver=resolver, resolver=resolver,
use_aiodns=use_aiodns) use_aiodns=use_aiodns)
if not hosts:
hosts = [(host, port)]
results = [] results = []
for host, port in hosts: for host, port in hosts:
if host == 'localhost': if host == 'localhost':