Visitar URL original
bpo-45383: Inherit MetaClass from bases in FromSpec API by seberg · Pull Request #28748 · python/cpython · GitHub
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
Use PyErr_Occurred rather than a variable
  • Loading branch information
encukou committed Jun 9, 2022
commit 2f47be342c056c4008ea111a11cf8dadb5f03d0e
4 changes: 1 addition & 3 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -3410,7 +3410,6 @@ PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module,
PyTypeObject *type;
PyObject *bases = NULL;
int r;
int success = 0;

const PyType_Slot *slot;
Py_ssize_t nmembers, weaklistoffset, dictoffset, vectorcalloffset;
Expand Down Expand Up @@ -3670,10 +3669,9 @@ PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module,
}

assert(_PyType_CheckConsistency(type));
success = 1;

finally:
if (!success) {
if (PyErr_Occurred()) {
Py_CLEAR(res);
}
Py_XDECREF(bases);
Expand Down