fix the type checking code
diff --git a/OpenSSL/py3k.h b/OpenSSL/py3k.h
index 4e7cff4..5811a6d 100644
--- a/OpenSSL/py3k.h
+++ b/OpenSSL/py3k.h
@@ -9,6 +9,7 @@
PyMODINIT_FUNC \
PyInit_##name(void)
+#define PyText_CheckExact PyUnicode_CheckExact
#define PyText_FromString PyUnicode_FromString
#define PyText_FromStringAndSize PyUnicode_FromStringAndSize
@@ -34,6 +35,7 @@
#define PyBytes_AsString PyString_AsString
#define PyBytes_FromStringAndSize PyString_FromStringAndSize
+#define PyText_CheckExact PyString_CheckExact
#define PyText_FromString PyString_FromString
#define PyText_FromStringAndSize PyString_FromStringAndSize
diff --git a/OpenSSL/ssl/context.c b/OpenSSL/ssl/context.c
index a30b51f..d4cae75 100644
--- a/OpenSSL/ssl/context.c
+++ b/OpenSSL/ssl/context.c
@@ -376,7 +376,7 @@
name_attr = asciiname;
}
#endif
- right_name = (PyUnicode_CheckExact(name_attr) &&
+ right_name = (PyText_CheckExact(name_attr) &&
strcmp(name, PyBytes_AsString(name_attr)) == 0);
Py_DECREF(name_attr);
res = (PyTypeObject *)type;