From 4c5e1a90b5fbd2a09b574d999d1131c671ce352b Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Mon, 22 Jul 2024 15:53:09 +0100 Subject: Fix detection of SHA1 signing support e._reason is an enum from cryptography.exceptions._Reasons so "is" should be the correct comparison, but it doesn't always work. This is apparently triggered by _Reasons moving to the part of cryptography that is implemented in rust, which doesn't yet implement enums as singletons. https://github.com/pyca/cryptography/issues/11332 https://github.com/PyO3/pyo3/issues/3059 --- tests/_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/_util.py b/tests/_util.py index acc06852..ead793f0 100644 --- a/tests/_util.py +++ b/tests/_util.py @@ -188,7 +188,7 @@ def sha1_signing_unsupported(): ) return False except UnsupportedAlgorithm as e: - return e._reason is _Reasons.UNSUPPORTED_HASH + return e._reason == _Reasons.UNSUPPORTED_HASH requires_sha1_signing = unittest.skipIf( -- cgit v1.2.3