bpo-39573: Use Py_IS_TYPE() macro to check for types (GH-18809)

Co-authored-by: Victor Stinner <vstinner@python.org>
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 4d6d255..29aeca4 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -6380,8 +6380,7 @@
 {
     long priority;
 
-    PyObject *SchedParamType = _posixstate_global->SchedParamType;
-    if (Py_TYPE(param) != (PyTypeObject *)SchedParamType) {
+    if (!Py_IS_TYPE(param, (PyTypeObject *)_posixstate_global->SchedParamType)) {
         PyErr_SetString(PyExc_TypeError, "must have a sched_param object");
         return 0;
     }