]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-151126: Add missing `PyErr_NoMemory()` in `type_from_slots_or_spec` (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 23 Jun 2026 15:12:29 +0000 (17:12 +0200)
committerGitHub <noreply@github.com>
Tue, 23 Jun 2026 15:12:29 +0000 (15:12 +0000)
(cherry picked from commit 7928a8b730b0334c9f97c2144ab00fe0d88f1e97)

Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
Misc/ACKS
Objects/typeobject.c

index c1216b21e3732121c41dd57184d9d0693bb90c47..29fc185ab3b4d06c6d6d1ab2d40c7a52ca963bc9 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -2079,6 +2079,7 @@ Xiang Zhang
 Robert Xiao
 Florent Xicluna
 Yanbo, Xie
+Ivy Xu
 Kaisheng Xu
 Xinhang Xu
 Arnon Yaari
index 8f44c99f6a7668920cff5d897c343c6463f82c7d..bbdfbfc03c98b1992b4fff0048daa6f479f79761 100644 (file)
@@ -4581,6 +4581,7 @@ _PyType_FromMetaclass_impl(
     Py_ssize_t name_buf_len = strlen(spec->name) + 1;
     _ht_tpname = PyMem_Malloc(name_buf_len);
     if (_ht_tpname == NULL) {
+        PyErr_NoMemory();
         goto finally;
     }
     memcpy(_ht_tpname, spec->name, name_buf_len);
@@ -4862,7 +4863,7 @@ _PyType_FromMetaclass_impl(
 
     assert(_PyType_CheckConsistency(type));
 
- finally:
+finally:
     if (PyErr_Occurred()) {
         Py_CLEAR(res);
     }