validate_rrsig = _need_pyca
_have_pyca = False
else:
- validate = _validate
- validate_rrsig = _validate_rrsig
+ validate = _validate # type: ignore
+ validate_rrsig = _validate_rrsig # type: ignore
_have_pyca = True
class DNSException(Exception):
supp_kwargs : Set[str]
kwargs : Optional[Dict]
+ fmt : Optional[str]
class SyntaxError(DNSException): ...
class FormError(DNSException): ...
try:
AF_INET6 = socket.AF_INET6
except AttributeError:
- AF_INET6 = 9999
+ AF_INET6 = 9999 # type: ignore
def inet_pton(family, text):
import struct
import sys
-import encodings.idna
+import encodings.idna # type: ignore
try:
- import idna
+ import idna # type: ignore
have_idna_2008 = True
except ImportError:
have_idna_2008 = False
import dns.exception
import dns.wiredata
-try:
- maxint = sys.maxint # pylint: disable=sys-max-int
-except AttributeError:
- maxint = (1 << (8 * struct.calcsize("P"))) // 2 - 1
-
+maxint = sys.maxsize
# fullcompare() result values
try:
import ssl
except ImportError:
- class ssl(object):
+ class ssl(object): # type: ignore
class WantReadException(Exception):
pass
class WantWriteException(Exception):
try:
import threading as _threading
except ImportError:
- import dummy_threading as _threading
+ import dummy_threading as _threading # type: ignore
import dns.exception
import dns.flags
port_answered = port
rcode = response.rcode()
if rcode == dns.rcode.YXDOMAIN:
- ex = YXDOMAIN()
- errors.append((nameserver, tcp_attempt, port, ex,
+ yex = YXDOMAIN()
+ errors.append((nameserver, tcp_attempt, port, yex,
response))
- raise ex
+ raise yex
if rcode == dns.rcode.NOERROR or \
rcode == dns.rcode.NXDOMAIN:
break