Skip to content

Commit

Permalink
bpo-20291: Fix MSVC warnings in getargs.c (GH-27211)
Browse files Browse the repository at this point in the history
* Fix MSVC warnings in getargs.c

* apply suggestions

Co-Authored-By: Batuhan Taskaya <batuhan@python.org>

Co-authored-by: Batuhan Taskaya <batuhan@python.org>
  • Loading branch information
Fidget-Spinner and isidentical authored Jul 17, 2021
1 parent 689b05c commit f88e138
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Python/getargs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2552,7 +2552,8 @@ _PyArg_UnpackKeywordsWithVararg(PyObject *const *args, Py_ssize_t nargs,
}

/* copy keyword args using kwtuple to drive process */
for (i = Py_MAX((int)nargs, posonly) - varargssize; i < maxargs; i++) {
for (i = Py_MAX((int)nargs, posonly) -
Py_SAFE_DOWNCAST(varargssize, Py_ssize_t, int); i < maxargs; i++) {
if (nkwargs) {
keyword = PyTuple_GET_ITEM(kwtuple, i - posonly);
if (kwargs != NULL) {
Expand Down

0 comments on commit f88e138

Please sign in to comment.