From d4b2baec6cad15d60c1bc9dc2c851e3d9f796c00 Mon Sep 17 00:00:00 2001 From: Andrey Kislyuk Date: Sun, 10 Dec 2023 23:01:36 -0800 Subject: [PATCH] Use isinstance instead of type comparison --- signxml/verifier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/signxml/verifier.py b/signxml/verifier.py index 7f43c5a..fe64f10 100644 --- a/signxml/verifier.py +++ b/signxml/verifier.py @@ -459,7 +459,7 @@ def verify( for idx, reference in enumerate(self._findall(signed_info, "Reference")): verify_results.append(self._verify_reference(reference, idx, root, uri_resolver, c14n_algorithm, signature)) - if type(self.config.expect_references) is int and len(verify_results) != self.config.expect_references: + if isinstance(self.config.expect_references, int) and len(verify_results) != self.config.expect_references: msg = "Expected to find {} references, but found {}" raise InvalidSignature(msg.format(self.config.expect_references, len(verify_results)))