Skip to content

Commit cb8d85d

Browse files
committed
pythongh-119011: Return an empty tuple on type_get_type_params as special case for PyType_Type
1 parent fe92193 commit cb8d85d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/typeobject.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,7 @@ static PyObject *
17431743
type_get_type_params(PyTypeObject *type, void *context)
17441744
{
17451745
PyObject *params;
1746-
if (PyDict_GetItemRef(lookup_tp_dict(type), &_Py_ID(__type_params__), &params) == 0) {
1746+
if (type == &PyType_Type || PyDict_GetItemRef(lookup_tp_dict(type), &_Py_ID(__type_params__), &params) == 0) {
17471747
return PyTuple_New(0);
17481748
}
17491749
return params;

0 commit comments

Comments
 (0)