Skip to content
Closed
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
Next Next commit
gh-119011: Return an empty tuple on type_get_type_params as special c…
…ase for PyType_Type
  • Loading branch information
mdkcore0 committed May 21, 2024
commit a49371355df088f6cea6b38ac681a21ac17153e2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This fixes an issue with ``functools.update_wrapper`` where it was not
returning a tuple for ``__type_params__`` as expected.
Comment thread
carljm marked this conversation as resolved.
Outdated
2 changes: 1 addition & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ static PyObject *
type_get_type_params(PyTypeObject *type, void *context)
{
PyObject *params;
if (PyDict_GetItemRef(lookup_tp_dict(type), &_Py_ID(__type_params__), &params) == 0) {
if (type == &PyType_Type || PyDict_GetItemRef(lookup_tp_dict(type), &_Py_ID(__type_params__), &params) == 0) {
return PyTuple_New(0);
}
return params;
Expand Down