From 8d397ee8259fa0f81598a452438fc335267ca260 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 21 Jul 2023 12:30:14 +0300 Subject: [PATCH] gh-47146: Fix reference counting in _testcapi.structmember initializer (GH-106862) --- Modules/_testcapi/structmember.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_testcapi/structmember.c b/Modules/_testcapi/structmember.c index 8522dc962ef..096eaecd408 100644 --- a/Modules/_testcapi/structmember.c +++ b/Modules/_testcapi/structmember.c @@ -193,7 +193,7 @@ _PyTestCapi_Init_Structmember(PyObject *m) if (res < 0) { return -1; } - res = PyModule_AddObject( + res = PyModule_AddObjectRef( m, "_test_structmembersType_OldAPI", (PyObject *)&test_structmembersType_OldAPI);