diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2019-11-18 00:18:50 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2019-11-18 13:18:50 +0800 |
commit | 1257600e1603ed57455d92758eb1da857cd61725 (patch) | |
tree | 5a5829854150a0b092b54803723fa842e6222ad6 /src/OpenSSL/SSL.py | |
parent | daf6f0060959c896fd724da5ade401ec70a8d1e5 (diff) | |
download | pyopenssl-git-1257600e1603ed57455d92758eb1da857cd61725.tar.gz |
Random cleanup around our usage of binary_type (#879)
Diffstat (limited to 'src/OpenSSL/SSL.py')
-rw-r--r-- | src/OpenSSL/SSL.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/OpenSSL/SSL.py b/src/OpenSSL/SSL.py index a228b73..ca39930 100644 --- a/src/OpenSSL/SSL.py +++ b/src/OpenSSL/SSL.py @@ -7,9 +7,7 @@ from itertools import count, chain from weakref import WeakValueDictionary from errno import errorcode -from six import ( - binary_type as _binary_type, integer_types as integer_types, int2byte, - indexbytes) +from six import integer_types, int2byte, indexbytes from OpenSSL._util import ( UNSPECIFIED as _UNSPECIFIED, @@ -461,7 +459,7 @@ class _ALPNSelectHelper(_CallbackExceptionHelper): if outbytes is NO_OVERLAPPING_PROTOCOLS: outbytes = b'' any_accepted = False - elif not isinstance(outbytes, _binary_type): + elif not isinstance(outbytes, bytes): raise TypeError( "ALPN callback must return a bytestring or the " "special NO_OVERLAPPING_PROTOCOLS sentinel value." @@ -529,7 +527,7 @@ class _OCSPServerCallbackHelper(_CallbackExceptionHelper): # Call the callback. ocsp_data = callback(conn, data) - if not isinstance(ocsp_data, _binary_type): + if not isinstance(ocsp_data, bytes): raise TypeError("OCSP callback must return a bytestring.") # If the OCSP data was provided, we will pass it to OpenSSL. |