Skip to content

Commit

Permalink
Handle error when importing older versions of pyOpenSSL
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
ronf committed Sep 22, 2024
1 parent bc587fc commit 2601966
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion asyncssh/crypto/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2601966

Please sign in to comment.