gh-93345: Fix a crash in substitution of nested TypeVar after TypeVarTuple (GH-93346)

For example: tuple[*Ts, list[T]][int, str, bool]
This commit is contained in:
Serhiy Storchaka 2022-05-31 08:46:16 +03:00 committed by GitHub
parent 5893b5db98
commit f545fc955a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -296,7 +296,7 @@ subs_tvars(PyObject *obj, PyObject *params,
else {
if (iparam >= 0) {
if (iparam > varparam) {
iparam += nargs - nsubargs;
iparam += nargs - nparams;
}
arg = argitems[iparam];
}