diff options
author | Matti Picus <matti.picus@gmail.com> | 2019-05-25 09:07:57 +0300 |
---|---|---|
committer | Matti Picus <matti.picus@gmail.com> | 2019-05-25 09:07:57 +0300 |
commit | f62a12786ff5040e21bc062e8e677ce62eeac86e (patch) | |
tree | d5fb18b58de68211c4c7709f9063e9b5e6bc03e2 /lib-python | |
parent | merge cffi-libs, which moves _ssl and _hashlib to cffi-based implementations (diff) | |
download | pypy-f62a12786ff5040e21bc062e8e677ce62eeac86e.tar.gz pypy-f62a12786ff5040e21bc062e8e677ce62eeac86e.tar.bz2 pypy-f62a12786ff5040e21bc062e8e677ce62eeac86e.zip |
untwist circular imports by adding legacy attributes to socket after import
Diffstat (limited to 'lib-python')
-rw-r--r-- | lib-python/2.7/socket.py | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/lib-python/2.7/socket.py b/lib-python/2.7/socket.py index 8a174186a9..2ae4b7be8c 100644 --- a/lib-python/2.7/socket.py +++ b/lib-python/2.7/socket.py @@ -61,20 +61,22 @@ else: DeprecationWarning, stacklevel=2) return _realssl.sslwrap_simple(sock, keyfile, certfile) - # we need to import the same constants we used to... - from _ssl import SSLError as sslerror - from _ssl import \ - RAND_add, \ - RAND_status, \ - SSL_ERROR_ZERO_RETURN, \ - SSL_ERROR_WANT_READ, \ - SSL_ERROR_WANT_WRITE, \ - SSL_ERROR_WANT_X509_LOOKUP, \ - SSL_ERROR_SYSCALL, \ - SSL_ERROR_SSL, \ - SSL_ERROR_WANT_CONNECT, \ - SSL_ERROR_EOF, \ - SSL_ERROR_INVALID_ERROR_CODE + # we need to import the same constants we used to, + # see lib_pypy/_cffi_ssl/_stdssl/error.py and __init__.py to prevent + # circular import + # from _ssl import SSLError as sslerror + # from _ssl import \ + # RAND_add, \ + # RAND_status + # SSL_ERROR_ZERO_RETURN, \ + # SSL_ERROR_WANT_READ, \ + # SSL_ERROR_WANT_WRITE, \ + # SSL_ERROR_WANT_X509_LOOKUP, \ + # SSL_ERROR_SYSCALL, \ + # SSL_ERROR_SSL, \ + # SSL_ERROR_WANT_CONNECT, \ + # SSL_ERROR_EOF, \ + # SSL_ERROR_INVALID_ERROR_CODE try: from _ssl import RAND_egd except ImportError: |