From: Pablo Galindo Salgado Date: Thu, 4 Aug 2022 21:44:06 +0000 (+0100) Subject: [3.11] gh-92678: Correct return values for errors in PyInit__testcapi (#95664) X-Git-Tag: v3.11.0rc1~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cb02dc0872195e79cf61616e29d3aefc8b0e664f;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-92678: Correct return values for errors in PyInit__testcapi (#95664) --- diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 961616dae63e..8087b444939f 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -7824,7 +7824,7 @@ PyInit__testcapi(void) PyObject *HeapCTypeWithDict2 = PyType_FromSpec(&HeapCTypeWithDict2_spec); if (HeapCTypeWithDict2 == NULL) { - return -1; + return NULL; } PyModule_AddObject(m, "HeapCTypeWithDict2", HeapCTypeWithDict2); @@ -7848,7 +7848,7 @@ PyInit__testcapi(void) PyObject *HeapCTypeWithWeakref2 = PyType_FromSpec(&HeapCTypeWithWeakref2_spec); if (HeapCTypeWithWeakref2 == NULL) { - return -1; + return NULL; } PyModule_AddObject(m, "HeapCTypeWithWeakref2", HeapCTypeWithWeakref2);