]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40989: Fix compiler warning in winreg.c (GH-21722)
authorVictor Stinner <vstinner@python.org>
Wed, 5 Aug 2020 14:23:10 +0000 (16:23 +0200)
committerGitHub <noreply@github.com>
Wed, 5 Aug 2020 14:23:10 +0000 (16:23 +0200)
Explicitly cast PyHKEYObject* to PyObject* to call _PyObject_Init().

PC/winreg.c

index a24d784c773c0270ad569e5a622c28c9032318d5..78c08693a8ace3527a1906ddc435f30b324727bc 100644 (file)
@@ -463,7 +463,7 @@ PyHKEY_FromHKEY(HKEY h)
     if (op == NULL) {
         return PyErr_NoMemory();
     }
-    _PyObject_Init(op, &PyHKEY_Type);
+    _PyObject_Init((PyObject*)op, &PyHKEY_Type);
     op->hkey = h;
     return (PyObject *)op;
 }