bpo-40989: Fix compiler warning in winreg.c (GH-21722)

Explicitly cast PyHKEYObject* to PyObject* to call _PyObject_Init().
This commit is contained in:
Victor Stinner 2020-08-05 16:23:10 +02:00 committed by GitHub
parent 8f4380d2f5
commit 15edaecd97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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;
}