From 2d6630c50663e9cd55d7485642bac2eda02e96a0 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Sun, 2 May 2021 17:12:38 -0700 Subject: [PATCH] Lint pass --- dns/_asyncbackend.py | 2 +- dns/_asyncio_backend.py | 5 ++--- dns/rdata.py | 3 +++ dns/rdtypes/ANY/ZONEMD.py | 1 - dns/rdtypes/svcbbase.py | 2 +- dns/rdtypes/util.py | 4 ++-- dns/resolver.py | 1 - dns/zone.py | 2 +- pylintrc | 1 + 9 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dns/_asyncbackend.py b/dns/_asyncbackend.py index 69411df6..1f3a8287 100644 --- a/dns/_asyncbackend.py +++ b/dns/_asyncbackend.py @@ -49,7 +49,7 @@ class DatagramSocket(Socket): # pragma: no cover class StreamSocket(Socket): # pragma: no cover - async def sendall(self, what, destination, timeout): + async def sendall(self, what, timeout): raise NotImplementedError async def recv(self, size, timeout): diff --git a/dns/_asyncio_backend.py b/dns/_asyncio_backend.py index 80c31dcd..4c8c0548 100644 --- a/dns/_asyncio_backend.py +++ b/dns/_asyncio_backend.py @@ -92,8 +92,8 @@ class StreamSocket(dns._asyncbackend.StreamSocket): self.writer.write(what) return await _maybe_wait_for(self.writer.drain(), timeout) - async def recv(self, count, timeout): - return await _maybe_wait_for(self.reader.read(count), + async def recv(self, size, timeout): + return await _maybe_wait_for(self.reader.read(size), timeout) async def close(self): @@ -147,4 +147,3 @@ class Backend(dns._asyncbackend.Backend): def datagram_connection_required(self): return _is_win32 - diff --git a/dns/rdata.py b/dns/rdata.py index 12f3b6f3..18e93cf6 100644 --- a/dns/rdata.py +++ b/dns/rdata.py @@ -51,6 +51,8 @@ def _wordbreak(data, chunksize=_chunksize): in range(0, len(data), chunksize)]).decode() +# pylint: disable=unused-argument + def _hexify(data, chunksize=_chunksize, **kw): """Convert a binary string into its hex encoding, broken up into chunks of chunksize characters separated by a space. @@ -66,6 +68,7 @@ def _base64ify(data, chunksize=_chunksize, **kw): return _wordbreak(base64.b64encode(data), chunksize) +# pylint: enable=unused-argument __escaped = b'"\\' diff --git a/dns/rdtypes/ANY/ZONEMD.py b/dns/rdtypes/ANY/ZONEMD.py index 0d9eedc6..035f7b32 100644 --- a/dns/rdtypes/ANY/ZONEMD.py +++ b/dns/rdtypes/ANY/ZONEMD.py @@ -1,6 +1,5 @@ # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license -import hashlib import struct import binascii diff --git a/dns/rdtypes/svcbbase.py b/dns/rdtypes/svcbbase.py index 49f35fee..2c76a58e 100644 --- a/dns/rdtypes/svcbbase.py +++ b/dns/rdtypes/svcbbase.py @@ -448,7 +448,7 @@ class SVCBBase(dns.rdata.Rdata): # The no-default-alpn parameter requires the alpn parameter. if ParamKey.NO_DEFAULT_ALPN in params: if ParamKey.ALPN not in params: - raise ValueError(f'no-default-alpn present, but alpn missing') + raise ValueError('no-default-alpn present, but alpn missing') def to_text(self, origin=None, relativize=True, **kw): target = self.target.choose_relativity(origin, relativize) diff --git a/dns/rdtypes/util.py b/dns/rdtypes/util.py index 7fc08cde..1f7e8211 100644 --- a/dns/rdtypes/util.py +++ b/dns/rdtypes/util.py @@ -225,7 +225,7 @@ def weighted_processing_order(iterable): break r -= weight total -= weight - ordered.append(rdata) - del rdatas[n] + ordered.append(rdata) # pylint: disable=undefined-loop-variable + del rdatas[n] # pylint: disable=undefined-loop-variable ordered.append(rdatas[0]) return ordered diff --git a/dns/resolver.py b/dns/resolver.py index e1de8cfc..10b6ca5a 100644 --- a/dns/resolver.py +++ b/dns/resolver.py @@ -137,7 +137,6 @@ def _errors_to_text(errors): """Turn a resolution errors trace into a list of text.""" texts = [] for err in errors: - # pylint: disable=bad-continuation texts.append('Server {} {} port {} answered {}'.format(err[0], 'TCP' if err[1] else 'UDP', err[2], err[3])) return texts diff --git a/dns/zone.py b/dns/zone.py index 86f12982..65eb35b2 100644 --- a/dns/zone.py +++ b/dns/zone.py @@ -745,7 +745,7 @@ class Zone(dns.transaction.TransactionManager): digest.scheme) if computed == digest.digest: return - except Exception as e: + except Exception: pass raise DigestVerificationFailure diff --git a/pylintrc b/pylintrc index 809d6540..49306612 100644 --- a/pylintrc +++ b/pylintrc @@ -29,6 +29,7 @@ disable= protected-access, redefined-builtin, too-many-lines, + raise-missing-from, # we should start doing this, but too noisy for now [REPORTS] -- 2.47.3