diff options
author | Hugo van Kemenade <hugovk@users.noreply.github.com> | 2019-08-30 00:39:35 +0300 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2019-08-29 17:39:35 -0400 |
commit | 60827f82d2ad7d2a94db093c2836595b46937c07 (patch) | |
tree | 45b1fbfe4a349858490d499fad72bc57abe002a2 /tests/test_ssl.py | |
parent | a18137385f574603535b29ad935f496d307ab3ae (diff) | |
download | pyopenssl-git-60827f82d2ad7d2a94db093c2836595b46937c07.tar.gz |
Fix for Python 4 (#862)
* Fix for Python 4
* Fix for Python 4
Diffstat (limited to 'tests/test_ssl.py')
-rw-r--r-- | tests/test_ssl.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_ssl.py b/tests/test_ssl.py index 7704c72..6b9422c 100644 --- a/tests/test_ssl.py +++ b/tests/test_ssl.py @@ -25,7 +25,7 @@ import pytest from pretend import raiser -from six import PY3, text_type +from six import PY2, text_type from cryptography import x509 from cryptography.hazmat.backends import default_backend @@ -101,7 +101,7 @@ V7H54LmltOT/hEh6QWsJqb6BQgH65bswvV/XkYGja8/T0GzvbaVzAgEC """ -skip_if_py3 = pytest.mark.skipif(PY3, reason="Python 2 only") +skip_if_py3 = pytest.mark.skipif(not PY2, reason="Python 2 only") def socket_any_family(): @@ -2138,7 +2138,7 @@ class TestConnection(object): with pytest.raises(TypeError): conn.set_tlsext_host_name(b"with\0null") - if PY3: + if not PY2: # On Python 3.x, don't accidentally implicitly convert from text. with pytest.raises(TypeError): conn.set_tlsext_host_name(b"example.com".decode("ascii")) |