diff options
author | Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> | 2022-07-09 04:18:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-09 04:18:01 (GMT) |
commit | 6442a9dd212fa18343db21849cf05c0181662c1f (patch) | |
tree | 469397015575dee1c5969762b7323508857053cd /Objects/genericaliasobject.c | |
parent | 8a285df806816805484fed36dce5fd5b77a215a6 (diff) | |
download | cpython-6442a9dd212fa18343db21849cf05c0181662c1f.zip cpython-6442a9dd212fa18343db21849cf05c0181662c1f.tar.gz cpython-6442a9dd212fa18343db21849cf05c0181662c1f.tar.bz2 |
gh-94607: Fix subclassing generics (GH-94610)
Co-authored-by: Serhiy Storchaka <3659035+serhiy-storchaka@users.noreply.github.com>
Diffstat (limited to 'Objects/genericaliasobject.c')
-rw-r--r-- | Objects/genericaliasobject.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c index b2636d5..19f011f 100644 --- a/Objects/genericaliasobject.c +++ b/Objects/genericaliasobject.c @@ -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; |