8000 gh-89546: Clean up PyType_FromMetaclass by encukou · Pull Request #93686 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-89546: Clean up PyType_FromMetaclass #93686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jun 14, 2022
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
Merge main branch to resolve conflicts
  • Loading branch information
encukou committed Jun 13, 2022
commit b197bb5bf76ced3d10c501e7a62945d25cda7514
8 changes: 4 additions & 4 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -3478,7 +3478,7 @@ PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module,
PyErr_SetString(
PyExc_SystemError,
"Multiple Py_tp_members slots are not supported.");
return NULL;
goto finally;
}
for (const PyMemberDef *memb = slot->pfunc; memb->name != NULL; memb++) {
nmembers++;
Expand Down Expand Up @@ -3509,7 +3509,7 @@ PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module,
PyErr_SetString(
PyExc_SystemError,
"Multiple Py_tp_doc slots are not supported.");
return NULL;
goto finally;
}
if (slot->pfunc == NULL) {
PyObject_Free(tp_doc);
Expand Down Expand Up @@ -3730,12 +3730,12 @@ PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module,
}

if (weaklistoffset) {
if (PyDict_DelItemString((PyObject *)type->tp_dict, "__weaklistoffset__") < 0) {
if (PyDict_DelItem((PyObject *)type->tp_dict, &_Py_ID(__weaklistoffset__)) < 0) {
goto finally;
}
}
if (dictoffset) {
if (PyDict_DelItemString((PyObject *)type->tp_dict, "__dictoffset__") < 0) {
if (PyDict_DelItem((PyObject *)type->tp_dict, &_Py_ID(__dictoffset__)) < 0) {
goto finally;
}
}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0