Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Comment that we don't want to call Python code while a type is half-b…
…uilt
  • Loading branch information
encukou committed Jun 10, 2022
commit 8bb54f861208d0d23646540e499a3b749341ca1b
8 changes: 7 additions & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -3560,7 +3560,13 @@ PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module,
// here we just check its work
assert(_PyType_HasFeature(base, Py_TPFLAGS_BASETYPE));

/* Allocate the new type */
/* Allocate the new type
*
* Between here and PyType_Ready, we should limit:
* - calls to Python code
* - raising exceptions
* - memory allocations
*/

res = (PyHeapTypeObject*)metaclass->tp_alloc(metaclass, nmembers);
if (res == NULL) {
Expand Down