Skip to content
Merged
Show file tree
Hide file tree
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
Apply suggestions from code review
Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
serhiy-storchaka and vstinner authored Nov 13, 2023
commit 2e6a25cec18df37baecf1c81675c49b7d7f6bc86
1 change: 0 additions & 1 deletion Objects/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,6 @@ _PyObject_GenericGetAttrWithDict(PyObject *obj, PyObject *name,
}
if (dict != NULL) {
Py_INCREF(dict);
res = PyDict_GetItemWithError(dict, name);
int rc = PyDict_GetItemRef(dict, name, &res);
Py_DECREF(dict);
if (res != NULL) {
Expand Down
10 changes: 6 additions & 4 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1432,9 +1432,11 @@ type_get_doc(PyTypeObject *type, void *context)
if (PyDict_GetItemRef(dict, &_Py_ID(__doc__), &result) == 0) {
result = Py_NewRef(Py_None);
}
else if (result && Py_TYPE(result)->tp_descr_get) {
Py_SETREF(result, Py_TYPE(result)->tp_descr_get(result, NULL,
(PyObject *)type));
else if (result) {
descrgetfunc descr_get = Py_TYPE(result)->tp_descr_get;
if (descr_get) {
Py_SETREF(result, descr_get(result, NULL, (PyObject *)type));
}
}
return result;
}
Expand Down Expand Up @@ -1523,7 +1525,7 @@ type_get_type_params(PyTypeObject *type, void *context)
{
PyObject *params;
if (PyDict_GetItemRef(lookup_tp_dict(type), &_Py_ID(__type_params__), &params) == 0) {
params = PyTuple_New(0);
return PyTuple_New(0);
Comment thread
serhiy-storchaka marked this conversation as resolved.
Outdated
}
return params;
}
Expand Down