https://github.com/python/cpython/commit/abf5016b4dd43dbab84b0be4e85446e645f8c1e1
commit: abf5016b4dd43dbab84b0be4e85446e645f8c1e1
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: StanFromIreland <[email protected]>
date: 2026-06-23T15:12:29Z
summary:

[3.13] gh-151126: Add missing `PyErr_NoMemory()` in `type_from_slots_or_spec` 
(GH-151582)

(cherry picked from commit 7928a8b730b0334c9f97c2144ab00fe0d88f1e97)

Co-authored-by: Ivy Xu <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>

files:
M Misc/ACKS
M Objects/typeobject.c

diff --git a/Misc/ACKS b/Misc/ACKS
index c1216b21e373212..29fc185ab3b4d06 100644
--- 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
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 8f44c99f6a76689..bbdfbfc03c98b19 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -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);
     }

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to