summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPaul Howarth <paul@city-fan.org>2024-07-22 15:53:09 +0100
committerJeff Forcier <jeff@bitprophet.org>2024-08-11 14:38:03 -0400
commit4c5e1a90b5fbd2a09b574d999d1131c671ce352b (patch)
treeba5836f408b792d2ef4f2ddaa097c2e4ef2da95a
parent7a8c0dc4869cac09242cfb21309b63279de4863e (diff)
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
-rw-r--r--tests/_util.py2
1 files changed, 1 insertions, 1 deletions
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(