checking for truthiness better than len

This commit is contained in:
Jeremy McMillan 2019-01-05 21:17:41 -06:00 committed by Pedro Algarvio
parent a984a43995
commit e1e5d874ba

View File

@ -1899,7 +1899,7 @@ def dns_check(addr, port, safe=False, ipv6=None):
except socket.error:
pass
if not resolved:
if len(candidates) > 0:
if candidates:
resolved = candidates[0]
else:
error = True