From b08733f9ebd1415417708c7a0945b1a94d6da8b9 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Thu, 25 Jun 2026 12:48:23 +0300 Subject: [PATCH] gh-151126: Fix missing `PyErr_NoMemory` in `testinternalcapi.c` (GH-152177) (cherry picked from commit a0093282ea87e112e3758e6b3eadb8b6b9770569) Co-authored-by: sobolevn --- Modules/_testinternalcapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index f9984da3671c8e3..c26785fe33fae03 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -1156,7 +1156,7 @@ pending_identify(PyObject *self, PyObject *args) PyThread_type_lock mutex = PyThread_allocate_lock(); if (mutex == NULL) { - return NULL; + return PyErr_NoMemory(); } PyThread_acquire_lock(mutex, WAIT_LOCK); /* It gets released in _pending_identify_callback(). */