From: Bob Halley Date: Sun, 6 Mar 2022 18:08:45 +0000 (-0800) Subject: LGTM lint X-Git-Tag: v2.3.0rc1~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=377dcc5052be127734240d52cb53174a1eda8e11;p=thirdparty%2Fdnspython.git LGTM lint --- diff --git a/dns/asyncquery.py b/dns/asyncquery.py index 3ac48dc3..950624a1 100644 --- a/dns/asyncquery.py +++ b/dns/asyncquery.py @@ -22,7 +22,6 @@ from typing import Any, Dict, Optional, Tuple, Union import base64 import socket import struct -import sys import time import dns.asyncbackend diff --git a/dns/dnssec.py b/dns/dnssec.py index bb20005e..810d12de 100644 --- a/dns/dnssec.py +++ b/dns/dnssec.py @@ -24,7 +24,7 @@ import struct import time import base64 -from dns.dnssectypes import * +from dns.dnssectypes import Algorithm, DSDigest, NSEC3Hash import dns.exception import dns.name diff --git a/dns/exception.py b/dns/exception.py index 550a1bcf..941c7a5f 100644 --- a/dns/exception.py +++ b/dns/exception.py @@ -22,7 +22,7 @@ always be subclasses of ``DNSException``. """ -from typing import Dict, Optional, Set +from typing import Optional, Set class DNSException(Exception): diff --git a/dns/immutable.py b/dns/immutable.py index 17515b1f..20da7d90 100644 --- a/dns/immutable.py +++ b/dns/immutable.py @@ -1,7 +1,6 @@ # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license import collections.abc -import sys from dns._immutable_ctx import immutable diff --git a/dns/message.py b/dns/message.py index 46c0a684..ec429fdc 100644 --- a/dns/message.py +++ b/dns/message.py @@ -1449,7 +1449,7 @@ def from_file(f, idna_codec=None, one_rr_per_rrset=False) -> Message: if isinstance(f, str): f = stack.enter_context(open(f)) return from_text(f, idna_codec, one_rr_per_rrset) - assert False # for mypy + assert False # for mypy lgtm[py/unreachable-statement] def make_query(qname, rdtype, rdclass=dns.rdataclass.IN, use_edns=None, diff --git a/dns/name.py b/dns/name.py index 29078eed..04fa2728 100644 --- a/dns/name.py +++ b/dns/name.py @@ -18,7 +18,7 @@ """DNS Names. """ -from typing import Any, Dict, Iterable, List, Optional, Tuple, Union +from typing import Dict, Iterable, Optional, Tuple, Union import copy import struct diff --git a/dns/node.py b/dns/node.py index a4c17f96..de017b43 100644 --- a/dns/node.py +++ b/dns/node.py @@ -17,7 +17,7 @@ """DNS nodes. A node is a set of rdatasets.""" -from typing import List, Optional, Union +from typing import List, Optional import enum import io diff --git a/dns/query.py b/dns/query.py index 9588621b..4757be8a 100644 --- a/dns/query.py +++ b/dns/query.py @@ -27,7 +27,6 @@ import os import selectors import socket import struct -import sys import time import urllib.parse @@ -586,7 +585,7 @@ def udp(q: dns.message.Message, where: str, timeout: Optional[float]=None, port= if not q.is_response(r): raise BadResponse return r - assert False # help mypy figure out we can't get here + assert False # help mypy figure out we can't get here lgtm[py/unreachable-statement] def udp_with_fallback(q: dns.message.Message, where: str, timeout: Optional[float]=None, port=53, source: Optional[str]=None, source_port=0, @@ -812,7 +811,7 @@ def tcp(q: dns.message.Message, where: str, timeout: Optional[float]=None, port= if not q.is_response(r): raise BadResponse return r - assert False # help mypy figure out we can't get here + assert False # help mypy figure out we can't get here lgtm[py/unreachable-statement] def _tls_handshake(s, expiration): @@ -907,7 +906,7 @@ def tls(q: dns.message.Message, where: str, timeout: Optional[float]=None, if not q.is_response(r): raise BadResponse return r - assert False # help mypy figure out we can't get here + assert False # help mypy figure out we can't get here lgtm[py/unreachable-statement] def xfr(where, zone, rdtype=dns.rdatatype.AXFR, rdclass=dns.rdataclass.IN, timeout=None, port=53, keyring=None, keyname=None, relativize=True, diff --git a/dns/rdataset.py b/dns/rdataset.py index 218adba3..33bee2f1 100644 --- a/dns/rdataset.py +++ b/dns/rdataset.py @@ -17,7 +17,7 @@ """DNS rdatasets (an rdataset is a set of rdatas of a given type and class)""" -from typing import Any, cast, Collection, Dict, List, Optional, Union +from typing import Any, cast, Collection, List, Optional, Union import io import random diff --git a/dns/resolver.py b/dns/resolver.py index 42d228d9..5f0f3628 100644 --- a/dns/resolver.py +++ b/dns/resolver.py @@ -17,7 +17,7 @@ """DNS stub resolver.""" -from typing import Any, Dict, List, Optional, Tuple, Union +from typing import Dict, List, Optional, Tuple, Union from urllib.parse import urlparse import contextlib diff --git a/dns/set.py b/dns/set.py index 40583549..faf968fa 100644 --- a/dns/set.py +++ b/dns/set.py @@ -16,7 +16,6 @@ # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. import itertools -import sys class Set: diff --git a/dns/tsigkeyring.py b/dns/tsigkeyring.py index 06a1bd09..ed117942 100644 --- a/dns/tsigkeyring.py +++ b/dns/tsigkeyring.py @@ -17,7 +17,7 @@ """A place to store TSIG keys.""" -from typing import Any, Dict, Union +from typing import Any, Dict import base64 diff --git a/dns/zone.py b/dns/zone.py index 7ab9e9de..a1fe07a9 100644 --- a/dns/zone.py +++ b/dns/zone.py @@ -20,7 +20,6 @@ from typing import Any, Dict, Iterator, List, Optional, Set, Tuple, Union import contextlib -import hashlib import io import os import struct @@ -1198,7 +1197,7 @@ def from_file(f: Any, origin: Optional[Union[dns.name.Name, str]]=None, f = stack.enter_context(open(f)) return from_text(f, origin, rdclass, relativize, zone_factory, filename, allow_include, check_origin) - assert False # make mypy happy + assert False # make mypy happy lgtm[py/unreachable-statement] def from_xfr(xfr, zone_factory=Zone, relativize=True, check_origin=True):