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

For example: tuple[*Ts, list[T]][int, str, bool]
(cherry picked from commit f545fc955a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2022-05-31 23:43:38 -07:00 committed by GitHub
parent 00f8fe9564
commit 3265ff9ccc
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];
}