diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-08-07 20:30:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-07 20:30:10 (GMT) |
commit | 540fcc62f5da982b79504221cac01bfab8b73ba1 (patch) | |
tree | 0e5b279cb9f2f358197a673ddf7a5a7959c07209 /Python | |
parent | e73e7a7abdc3fed252affcb1629df1b3c8fff2ef (diff) | |
download | cpython-540fcc62f5da982b79504221cac01bfab8b73ba1.zip cpython-540fcc62f5da982b79504221cac01bfab8b73ba1.tar.gz cpython-540fcc62f5da982b79504221cac01bfab8b73ba1.tar.bz2 |
gh-118814: Fix the TypeVar constructor when name is passed by keyword (GH-122664)
Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for
positional-or-keyword parameter is passed by keyword.
There was only one such case in the stdlib -- the TypeVar constructor.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/getargs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index ec2eeb15..1b9b399 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -2601,7 +2601,7 @@ _PyArg_UnpackKeywordsWithVararg(PyObject *const *args, Py_ssize_t nargs, * * Otherwise, we leave a place at `buf[vararg]` for vararg tuple * so the index is `i + 1`. */ - if (nargs < vararg && i != vararg) { + if (i < vararg) { buf[i] = current_arg; } else { |