mirror of
https://github.com/python/cpython.git
synced 2025-08-28 04:35:02 +00:00
[3.13] gh-118814: Fix the TypeVar constructor when name is passed by keyword (GH-122664) (GH-122806)
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.
(cherry picked from commit 540fcc62f5
)
This commit is contained in:
parent
bc8368e9d0
commit
1fd1c6c738
6 changed files with 165 additions and 7 deletions
|
@ -2574,7 +2574,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