From 2601966a22d1eff2dee4f63379162d39cdd11360 Mon Sep 17 00:00:00 2001 From: Ron Frederick Date: Sat, 21 Sep 2024 17:30:52 -0700 Subject: [PATCH] Handle error when importing older versions of pyOpenSSL This commit catches an AttributeError which can occur if the version of pyOpenSSL on the system is older than 23.0.0. With this change, an older version is treated the same as not having pyOpenSSL installed at all. Thanks go to Maximilian Knespel for reporting this issue and testing the fix! --- asyncssh/crypto/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asyncssh/crypto/__init__.py b/asyncssh/crypto/__init__.py index ef6c8e5..5d145da 100644 --- a/asyncssh/crypto/__init__.py +++ b/asyncssh/crypto/__init__.py @@ -57,5 +57,5 @@ try: from .x509 import X509Certificate, X509Name, X509NamePattern from .x509 import generate_x509_certificate, import_x509_certificate -except ImportError: # pragma: no cover +except (ImportError, AttributeError): # pragma: no cover pass