amend to c2d2e79b0d48bf66b04c3772c2419f30a4b1f9db: fixed sporadically bug in getBanListExtendedCymruInfo:

except dns.resolver.NXDOMAIN:
UnboundLocalError: local variable 'dns' referenced before assignment
pull/1571/head
sebres 2016-10-05 15:43:39 +02:00
parent 973ac9a45c
commit 2d2d4cf185
1 changed files with 1 additions and 0 deletions

View File

@ -135,6 +135,7 @@ class BanManager:
def getBanListExtendedCymruInfo(self, timeout=10):
return_dict = {"asn": [], "country": [], "rir": []}
if not hasattr(self, 'dnsResolver'):
global dns
try:
import dns.exception
import dns.resolver