diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2017-06-29 21:46:42 -0700 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2017-06-29 23:46:42 -0500 |
commit | 336d80238465cb3426e2705091709a6292457043 (patch) | |
tree | 5d2b1e1c2b586156ce3e2101cc0dd4951f1e0e2e | |
parent | aa32e71de55f5f00666bacac5d8d691f17e60d34 (diff) | |
download | pyopenssl-336d80238465cb3426e2705091709a6292457043.tar.gz |
Kill dead code (#647)
* Simplify code
* dead code
* unused...
* write imports normally
-rw-r--r-- | src/OpenSSL/SSL.py | 11 | ||||
-rw-r--r-- | tests/test_ssl.py | 5 |
2 files changed, 5 insertions, 11 deletions
diff --git a/src/OpenSSL/SSL.py b/src/OpenSSL/SSL.py index b571a5e..b17d25b 100644 --- a/src/OpenSSL/SSL.py +++ b/src/OpenSSL/SSL.py @@ -8,9 +8,9 @@ from errno import errorcode from cryptography.utils import deprecated -from six import binary_type as _binary_type -from six import integer_types as integer_types -from six import int2byte, indexbytes +from six import ( + binary_type as _binary_type, integer_types as integer_types, int2byte, + indexbytes) from OpenSSL._util import ( UNSPECIFIED as _UNSPECIFIED, @@ -59,9 +59,8 @@ TLSv1_2_METHOD = 6 OP_NO_SSLv2 = _lib.SSL_OP_NO_SSLv2 OP_NO_SSLv3 = _lib.SSL_OP_NO_SSLv3 OP_NO_TLSv1 = _lib.SSL_OP_NO_TLSv1 - -OP_NO_TLSv1_1 = getattr(_lib, "SSL_OP_NO_TLSv1_1", 0) -OP_NO_TLSv1_2 = getattr(_lib, "SSL_OP_NO_TLSv1_2", 0) +OP_NO_TLSv1_1 = _lib.SSL_OP_NO_TLSv1_1 +OP_NO_TLSv1_2 = _lib.SSL_OP_NO_TLSv1_2 MODE_RELEASE_BUFFERS = _lib.SSL_MODE_RELEASE_BUFFERS diff --git a/tests/test_ssl.py b/tests/test_ssl.py index 1ca7f8b..5bb4451 100644 --- a/tests/test_ssl.py +++ b/tests/test_ssl.py @@ -66,11 +66,6 @@ from OpenSSL.SSL import ( OP_NO_QUERY_MTU, OP_COOKIE_EXCHANGE, OP_NO_TICKET, OP_NO_COMPRESSION, MODE_RELEASE_BUFFERS) -try: - from OpenSSL.SSL import OP_NO_TLSv1, OP_NO_TLSv1_1, OP_NO_TLSv1_2 -except ImportError: - OP_NO_TLSv1 = OP_NO_TLSv1_1 = OP_NO_TLSv1_2 = None - from OpenSSL.SSL import ( SSL_ST_CONNECT, SSL_ST_ACCEPT, SSL_ST_MASK, SSL_CB_LOOP, SSL_CB_EXIT, SSL_CB_READ, SSL_CB_WRITE, SSL_CB_ALERT, |