mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-94607: Fix subclassing generics (GH-94610)
Co-authored-by: Serhiy Storchaka <3659035+serhiy-storchaka@users.noreply.github.com>
This commit is contained in:
parent
8a285df806
commit
6442a9dd21
4 changed files with 38 additions and 0 deletions
|
@ -219,6 +219,10 @@ _Py_make_parameters(PyObject *args)
|
|||
for (Py_ssize_t iarg = 0; iarg < nargs; iarg++) {
|
||||
PyObject *t = PyTuple_GET_ITEM(args, iarg);
|
||||
PyObject *subst;
|
||||
// We don't want __parameters__ descriptor of a bare Python class.
|
||||
if (PyType_Check(t)) {
|
||||
continue;
|
||||
}
|
||||
if (_PyObject_LookupAttr(t, &_Py_ID(__typing_subst__), &subst) < 0) {
|
||||
Py_DECREF(parameters);
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue