]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
more lint
authorBob Halley <halley@dnspython.org>
Sun, 2 Oct 2022 17:04:05 +0000 (10:04 -0700)
committerBob Halley <halley@dnspython.org>
Sun, 2 Oct 2022 17:04:05 +0000 (10:04 -0700)
dns/asyncquery.py
dns/enum.py
dns/message.py
dns/rdataset.py
dns/win32util.py
dns/zone.py
dns/zonefile.py

index dd1fba4a80b2a994c57833b8a905ea6f9cfbe458..107f7667e00264eeda0f233da9bdd6ea66f3eb8a 100644 (file)
@@ -482,7 +482,7 @@ async def https(
     timeout: Optional[float] = None,
     port: int = 443,
     source: Optional[str] = None,
-    source_port: int = 0,
+    source_port: int = 0,  # pylint: disable=W0613
     one_rr_per_rrset: bool = False,
     ignore_trailing: bool = False,
     client: Optional["httpx.AsyncClient"] = None,
index 0eeafd4bf728378fa5503c3344322eb396018951..b5a4aed8efee94937436e2b8ef7dd7a9f62d5d07 100644 (file)
@@ -94,11 +94,11 @@ class IntEnum(enum.IntEnum):
         return ""
 
     @classmethod
-    def _extra_from_text(cls, text):
+    def _extra_from_text(cls, text):  # pylint: disable=W0613
         return None
 
     @classmethod
-    def _extra_to_text(cls, value, current_text):
+    def _extra_to_text(cls, value, current_text):  # pylint: disable=W0613
         return current_text
 
     @classmethod
index 507a5b08eeb37153ee82be2d2f9b5d2532804935..8250db3b0ac8a16f1cb02636007b2052c84ead06 100644 (file)
@@ -1096,8 +1096,8 @@ class _WireReader:
                 (rdclass, rdtype, deleting, empty) = self.message._parse_rr_header(
                     section_number, name, rdclass, rdtype
                 )
+            rdata_start = self.parser.current
             try:
-                rdata_start = self.parser.current
                 if empty:
                     if rdlen > 0:
                         raise dns.exception.FormError
index 072e7f7239c422e03afba11f64142f9ec5180921..c0ede425098db8f390506f76ead2e00e31507172 100644 (file)
@@ -98,9 +98,9 @@ class Rdataset(dns.set.Set):
         elif ttl < self.ttl:
             self.ttl = ttl
 
-    def add(
+    def add(  # pylint: disable=arguments-differ,arguments-renamed
         self, rd: dns.rdata.Rdata, ttl: Optional[int] = None
-    ) -> None:  # pylint: disable=arguments-differ
+    ) -> None:
         """Add the specified rdata to the rdataset.
 
         If the optional *ttl* parameter is supplied, then
index deebc818b8b04b8aa860c1f33a7d315f7e0dc0ce..b9db29123634c64933e65303259e484ce9343dbd 100644 (file)
@@ -8,12 +8,18 @@ if sys.platform == "win32":
 
     _prefer_wmi = True
 
-    import winreg
+    import winreg  # pylint: disable=import-error
+
+    # Keep pylint quiet on non-windows.
+    try:
+        WindowsError is None  # pylint: disable=used-before-assignment
+    except KeyError:
+        WindowsError = Exception
 
     try:
         import threading
-        import pythoncom
-        import wmi
+        import pythoncom  # pylint: disable=import-error
+        import wmi  # pylint: disable=import-error
 
         _have_wmi = True
     except Exception:
index d3bdb3b504874d53f2d0476c3ed641b71e5d0753..cc8268da346fe084daa774e6d38c605a7c4ef4aa 100644 (file)
@@ -904,8 +904,6 @@ class VersionedNode(dns.node.Node):  # lgtm[py/missing-equals]
 
 @dns.immutable.immutable
 class ImmutableVersionedNode(VersionedNode):
-    __slots__ = ["id"]
-
     def __init__(self, node):
         super().__init__()
         self.id = node.id
index a04ccf39a80cc084bc4c40316ba1575f080b0129..1a53f5bcfca59906d7eb96b6dc1ff2cd50b4f596 100644 (file)
@@ -603,6 +603,9 @@ class RRsetsReaderTransaction(dns.transaction.Transaction):
     def _set_origin(self, origin):
         pass
 
+    def _iterate_rdatasets(self):
+        raise NotImplementedError  # pragma: no cover
+
 
 class RRSetsReaderManager(dns.transaction.TransactionManager):
     def __init__(
@@ -613,6 +616,9 @@ class RRSetsReaderManager(dns.transaction.TransactionManager):
         self.rdclass = rdclass
         self.rrsets = []
 
+    def reader(self):  # pragma: no cover
+        raise NotImplementedError
+
     def writer(self, replacement=False):
         assert replacement is True
         return RRsetsReaderTransaction(self, True, False)