summaryrefslogtreecommitdiffstats
path: root/Lib/ssl.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-06 12:54:58 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-01-06 12:54:58 (GMT)
commitfcfed1991382f9697df574fae4115a9f815adca0 (patch)
tree5f9519dcdc56aab61eea2e7d6ef280f1f70e47f5 /Lib/ssl.py
parent9d01717f373d0180e2804c827efbc40d8cf72063 (diff)
downloadcpython-fcfed1991382f9697df574fae4115a9f815adca0.zip
cpython-fcfed1991382f9697df574fae4115a9f815adca0.tar.gz
cpython-fcfed1991382f9697df574fae4115a9f815adca0.tar.bz2
Issue #21356: Make ssl.RAND_egd() optional to support LibreSSL. The
availability of the function is checked during the compilation. Patch written by Bernard Spil.
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r--Lib/ssl.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py
index 3b667ff..8c75f00 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -106,7 +106,12 @@ from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
from _ssl import (VERIFY_DEFAULT, VERIFY_CRL_CHECK_LEAF, VERIFY_CRL_CHECK_CHAIN,
VERIFY_X509_STRICT)
from _ssl import txt2obj as _txt2obj, nid2obj as _nid2obj
-from _ssl import RAND_status, RAND_egd, RAND_add, RAND_bytes, RAND_pseudo_bytes
+from _ssl import RAND_status, RAND_add, RAND_bytes, RAND_pseudo_bytes
+try:
+ from _ssl import RAND_egd
+except ImportError:
+ # LibreSSL does not provide RAND_egd
+ pass
def _import_symbols(prefix):
for n in dir(_ssl):