]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111178: Fix function signatures for test_zoneinfo (#131664)
authorVictor Stinner <vstinner@python.org>
Mon, 24 Mar 2025 13:32:46 +0000 (14:32 +0100)
committerGitHub <noreply@github.com>
Mon, 24 Mar 2025 13:32:46 +0000 (14:32 +0100)
Modules/_zoneinfo.c

index 7e761b287792e159b72685b51cadfffa79fd31a8..b736b7e04986d58a2317b9f03eb4b285c6a2f1fa 100644 (file)
@@ -2580,14 +2580,14 @@ initialize_caches(zoneinfo_state *state)
 }
 
 static PyObject *
-zoneinfo_init_subclass(PyTypeObject *cls, PyObject *args, PyObject **kwargs)
+zoneinfo_init_subclass(PyObject *cls, PyObject *args, PyObject *kwargs)
 {
     PyObject *weak_cache = new_weak_cache();
     if (weak_cache == NULL) {
         return NULL;
     }
 
-    if (PyObject_SetAttrString((PyObject *)cls, "_weak_cache",
+    if (PyObject_SetAttrString(cls, "_weak_cache",
                                weak_cache) < 0) {
         Py_DECREF(weak_cache);
         return NULL;
@@ -2611,7 +2611,7 @@ static PyMethodDef zoneinfo_methods[] = {
     {"__reduce__", (PyCFunction)zoneinfo_reduce, METH_NOARGS,
      PyDoc_STR("Function for serialization with the pickle protocol.")},
     ZONEINFO_ZONEINFO__UNPICKLE_METHODDEF
-    {"__init_subclass__", (PyCFunction)(void (*)(void))zoneinfo_init_subclass,
+    {"__init_subclass__", _PyCFunction_CAST(zoneinfo_init_subclass),
      METH_VARARGS | METH_KEYWORDS | METH_CLASS,
      PyDoc_STR("Function to initialize subclasses.")},
     {NULL} /* Sentinel */