]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] gh-151126: Fix missing `PyErr_NoMemory` in `testinternalcapi.c` (GH-152177...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 25 Jun 2026 10:19:48 +0000 (12:19 +0200)
committerGitHub <noreply@github.com>
Thu, 25 Jun 2026 10:19:48 +0000 (13:19 +0300)
gh-151126: Fix missing `PyErr_NoMemory` in `testinternalcapi.c` (GH-152177)
(cherry picked from commit a0093282ea87e112e3758e6b3eadb8b6b9770569)

Co-authored-by: sobolevn <mail@sobolevn.me>
Modules/_testinternalcapi.c

index b8a22c439e853d931f5f2ceb019577fc2e00c1ef..92a49d003ca73596be07ef446971b0ce911da658 100644 (file)
@@ -1912,7 +1912,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(). */