From: Bob Halley Date: Sat, 31 Jan 2026 14:28:50 +0000 (-0800) Subject: ty 0.0.14 lint X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3869aebb97e842ceecd03061a3524a5690eb45ee;p=thirdparty%2Fdnspython.git ty 0.0.14 lint --- diff --git a/dns/tsig.py b/dns/tsig.py index 333f9aa4..ce736f1e 100644 --- a/dns/tsig.py +++ b/dns/tsig.py @@ -183,7 +183,7 @@ class HMACTSig: # create the HMAC context if isinstance(hashinfo, tuple): - self.hmac_context = hmac.new(key, digestmod=hashinfo[0]) + self.hmac_context = hmac.new(key, digestmod=hashinfo[0]) # type: ignore self.size = hashinfo[1] else: self.hmac_context = hmac.new(key, digestmod=hashinfo) @@ -199,6 +199,7 @@ class HMACTSig: # defer to the HMAC digest() function for that digestmod digest = self.hmac_context.digest() if self.size: + assert isinstance(self.size, int) digest = digest[: (self.size // 8)] return digest