From: Bob Halley Date: Sun, 25 Jun 2023 21:09:22 +0000 (-0700) Subject: Deal with pylint being confused. X-Git-Tag: v2.4.0rc1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14d120e47252374931a41d613a802082d32207d6;p=thirdparty%2Fdnspython.git Deal with pylint being confused. --- diff --git a/dns/dnssecalgs/base.py b/dns/dnssecalgs/base.py index c70b0812..e990575a 100644 --- a/dns/dnssecalgs/base.py +++ b/dns/dnssecalgs/base.py @@ -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 diff --git a/dns/dnssecalgs/cryptography.py b/dns/dnssecalgs/cryptography.py index b5bcd2ef..5a31a812 100644 --- a/dns/dnssecalgs/cryptography.py +++ b/dns/dnssecalgs/cryptography.py @@ -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