Skip to content

Commit 2601966

Browse files
committed
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!
1 parent bc587fc commit 2601966

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

asyncssh/crypto/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@
5757
try:
5858
from .x509 import X509Certificate, X509Name, X509NamePattern
5959
from .x509 import generate_x509_certificate, import_x509_certificate
60-
except ImportError: # pragma: no cover
60+
except (ImportError, AttributeError): # pragma: no cover
6161
pass

0 commit comments

Comments
 (0)