From d2ec81a8c99796b51fb8c49b77a7fe369863226f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 7 Feb 2020 09:17:07 +0100 Subject: bpo-39573: Add Py_SET_TYPE() function (GH-18394) Add Py_SET_TYPE() function to set the type of an object. --- Modules/_testcapimodule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Modules/_testcapimodule.c') diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 3bb1bf1e27..e6d30341cd 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -6605,9 +6605,9 @@ PyInit__testcapi(void) if (m == NULL) return NULL; - Py_TYPE(&_HashInheritanceTester_Type)=&PyType_Type; + Py_SET_TYPE(&_HashInheritanceTester_Type, &PyType_Type); - Py_TYPE(&test_structmembersType)=&PyType_Type; + Py_SET_TYPE(&test_structmembersType, &PyType_Type); Py_INCREF(&test_structmembersType); /* don't use a name starting with "test", since we don't want test_capi to automatically call this */ -- cgit v1.2.1