summaryrefslogtreecommitdiffstats
path: root/Lib/socket.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-06 12:53:37 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-01-06 12:53:37 (GMT)
commit7c90667f74161c790227a2cb473c4e0c794ad884 (patch)
tree4c4ece5cbd42fad074369781a370df082930df16 /Lib/socket.py
parent7ba8cdc31c2704f3c9017fb66ce14fc0983d68f8 (diff)
downloadcpython-7c90667f74161c790227a2cb473c4e0c794ad884.zip
cpython-7c90667f74161c790227a2cb473c4e0c794ad884.tar.gz
cpython-7c90667f74161c790227a2cb473c4e0c794ad884.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/socket.py')
-rw-r--r--Lib/socket.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/socket.py b/Lib/socket.py
index aac04f6..614af29 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -67,7 +67,6 @@ else:
from _ssl import SSLError as sslerror
from _ssl import \
RAND_add, \
- RAND_egd, \
RAND_status, \
SSL_ERROR_ZERO_RETURN, \
SSL_ERROR_WANT_READ, \
@@ -78,6 +77,11 @@ else:
SSL_ERROR_WANT_CONNECT, \
SSL_ERROR_EOF, \
SSL_ERROR_INVALID_ERROR_CODE
+ try:
+ from _ssl import RAND_egd
+ except ImportError:
+ # LibreSSL does not provide RAND_egd
+ pass
import os, sys, warnings