diff options
author | Zackery Spytz <zspytz@gmail.com> | 2020-04-06 00:47:47 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-06 07:47:47 +0100 |
commit | 08050e959e6c40839cd2c9e5f6a4fd1513e3d605 (patch) | |
tree | 6ec7472460269035a9b7b5cd12d3f7b5b3ed85cf /Python/compile.c | |
parent | c63629e7c09da80a6b7d0253d04a9b3f57f88eff (diff) | |
download | cpython-git-08050e959e6c40839cd2c9e5f6a4fd1513e3d605.tar.gz |
bpo-40147: Fix a compiler warning on Windows in Python/compile.c (GH-19389)
Change the type of nkeywords to Py_ssize_t.
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Python/compile.c b/Python/compile.c index b1c1982fd2..329add9d06 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -4050,14 +4050,15 @@ maybe_optimize_method_call(struct compiler *c, expr_ty e) } static int -validate_keywords(struct compiler *c, asdl_seq* keywords) { - int nkeywords = asdl_seq_LEN(keywords); - for (int i = 0; i < nkeywords; i++) { +validate_keywords(struct compiler *c, asdl_seq *keywords) +{ + Py_ssize_t nkeywords = asdl_seq_LEN(keywords); + for (Py_ssize_t i = 0; i < nkeywords; i++) { keyword_ty key = ((keyword_ty)asdl_seq_GET(keywords, i)); if (key->arg == NULL) { continue; } - for (int j = i+1; j < nkeywords; j++) { + for (Py_ssize_t j = i + 1; j < nkeywords; j++) { keyword_ty other = ((keyword_ty)asdl_seq_GET(keywords, j)); if (other->arg && !PyUnicode_Compare(key->arg, other->arg)) { PyObject *msg = PyUnicode_FromFormat("keyword argument repeated: %U", key->arg); |