mirror of
https://github.com/python/cpython.git
synced 2025-08-25 03:04:55 +00:00
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.
This commit is contained in:
parent
e73e7a7abd
commit
540fcc62f5
6 changed files with 165 additions and 7 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue