]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Deal with pylint being confused.
authorBob Halley <halley@dnspython.org>
Sun, 25 Jun 2023 21:09:22 +0000 (14:09 -0700)
committerBob Halley <halley@dnspython.org>
Sun, 25 Jun 2023 21:09:22 +0000 (14:09 -0700)
dns/dnssecalgs/base.py
dns/dnssecalgs/cryptography.py

index c70b081207c4f3ffd4af356b9e191631d3de1db6..e990575a30ca19a9679ff2e3125f039d4c245b3e 100644 (file)
@@ -1,5 +1,5 @@
-from abc import ABC, abstractmethod
-from typing import Optional, Type, Any
+from abc import ABC, abstractmethod  # pylint: disable=no-name-in-module
+from typing import Any, Optional, Type
 
 import dns.rdataclass
 import dns.rdatatype
index b5bcd2efc9d98572d52cef60089352aa49227308..5a31a8123db92080e9976795b2350dacbdc65abb 100644 (file)
@@ -10,10 +10,12 @@ class CryptographyPublicKey(GenericPublicKey):
     key: Any = None
     key_cls: Any = None
 
-    def __init__(self, key: Any) -> None:
+    def __init__(self, key: Any) -> None:  # pylint: disable=super-init-not-called
         if self.key_cls is None:
             raise TypeError("Undefined private key class")
-        if not isinstance(key, self.key_cls):
+        if not isinstance(  # pylint: disable=isinstance-second-argument-not-valid-type
+            key, self.key_cls
+        ):
             raise AlgorithmKeyMismatch
         self.key = key
 
@@ -34,10 +36,12 @@ class CryptographyPrivateKey(GenericPrivateKey):
     key_cls: Any = None
     public_cls: Type[CryptographyPublicKey]
 
-    def __init__(self, key: Any) -> None:
+    def __init__(self, key: Any) -> None:  # pylint: disable=super-init-not-called
         if self.key_cls is None:
             raise TypeError("Undefined private key class")
-        if not isinstance(key, self.key_cls):
+        if not isinstance(  # pylint: disable=isinstance-second-argument-not-valid-type
+            key, self.key_cls
+        ):
             raise AlgorithmKeyMismatch
         self.key = key