Fix for Python 4 (#862)

* Fix for Python 4

* Fix for Python 4
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 @@
 
 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 @@
 """
 
 
-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 @@
         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"))
diff --git a/tests/util.py b/tests/util.py
index 4464379..65b905a 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -6,7 +6,7 @@
 U{Twisted<http://twistedmatrix.com/>}.
 """
 
-from six import PY3
+from six import PY2
 
 
 # This is the UTF-8 encoding of the SNOWMAN unicode code point.
@@ -152,7 +152,7 @@
 
 
 # The type name expected in warnings about using the wrong string type.
-if PY3:
-    WARNING_TYPE_EXPECTED = "str"
-else:
+if PY2:
     WARNING_TYPE_EXPECTED = "unicode"
+else:
+    WARNING_TYPE_EXPECTED = "str"