https://github.com/python/cpython/commit/72153b504a7189e2d36d38df9ab7b6c2e124660b commit: 72153b504a7189e2d36d38df9ab7b6c2e124660b branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: StanFromIreland <[email protected]> date: 2026-06-23T15:14:39Z summary:
[3.14] 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 00a4c4a8a58786..2f0cfb5b552b34 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -2108,6 +2108,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 a887d724b92df0..40cb8816c8342a 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -5114,6 +5114,7 @@ PyType_FromMetaclass( 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); @@ -5397,7 +5398,7 @@ PyType_FromMetaclass( 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]
