From 4855d71ad5535bdff47a0dc5cfe09fb610ff6576 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Sat, 15 Apr 2023 20:41:24 +0100 Subject: [PATCH] Fix test_ssl_object_attributes Co-authored-by: Seth Michael Larson --- test/test_ssltransport.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test_ssltransport.py b/test/test_ssltransport.py index a3b7381639..cace51db96 100644 --- a/test/test_ssltransport.py +++ b/test/test_ssltransport.py @@ -229,8 +229,11 @@ def test_ssl_object_attributes(self) -> None: assert ssock.selected_npn_protocol() is None shared_ciphers = ssock.shared_ciphers() - assert type(shared_ciphers) == list - assert len(shared_ciphers) > 0 + # SSLContext.shared_ciphers() changed behavior completely in a patch version. + # See: https://github.com/python/cpython/issues/96931 + assert shared_ciphers is None or ( + type(shared_ciphers) is list and len(shared_ciphers) > 0 + ) assert ssock.compression() is None