diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-06 12:53:37 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-06 12:53:37 (GMT) |
commit | 7c90667f74161c790227a2cb473c4e0c794ad884 (patch) | |
tree | 4c4ece5cbd42fad074369781a370df082930df16 /Lib/socket.py | |
parent | 7ba8cdc31c2704f3c9017fb66ce14fc0983d68f8 (diff) | |
download | cpython-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.py | 6 |
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 |