summaryrefslogtreecommitdiffstats
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2024-06-24 16:11:47 (GMT)
committerGitHub <noreply@github.com>2024-06-24 16:11:47 (GMT)
commite7315543377322e4c6e0d8d2c4a4bb4626e43f4c (patch)
tree956e3eb3c667a53aa60954e36916d165f2333bab /Python/symtable.c
parent2e157851e36d83b0cb079b161d633b16ab899d16 (diff)
downloadcpython-e7315543377322e4c6e0d8d2c4a4bb4626e43f4c.zip
cpython-e7315543377322e4c6e0d8d2c4a4bb4626e43f4c.tar.gz
cpython-e7315543377322e4c6e0d8d2c4a4bb4626e43f4c.tar.bz2
Fixes loop variables to be the same types as their limit (GH-120958)
Diffstat (limited to 'Python/symtable.c')
-rw-r--r--Python/symtable.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index a8e4ba3..2e56ea6 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -398,7 +398,7 @@ _PySymtable_Build(mod_ty mod, PyObject *filename, _PyFutureFeatures *future)
{
struct symtable *st = symtable_new();
asdl_stmt_seq *seq;
- int i;
+ Py_ssize_t i;
PyThreadState *tstate;
int starting_recursion_depth;
@@ -1594,7 +1594,7 @@ symtable_enter_type_param_block(struct symtable *st, identifier name,
#define VISIT_SEQ(ST, TYPE, SEQ) \
do { \
- int i; \
+ Py_ssize_t i; \
asdl_ ## TYPE ## _seq *seq = (SEQ); /* avoid variable capture */ \
for (i = 0; i < asdl_seq_LEN(seq); i++) { \
TYPE ## _ty elt = (TYPE ## _ty)asdl_seq_GET(seq, i); \
@@ -1605,7 +1605,7 @@ symtable_enter_type_param_block(struct symtable *st, identifier name,
#define VISIT_SEQ_TAIL(ST, TYPE, SEQ, START) \
do { \
- int i; \
+ Py_ssize_t i; \
asdl_ ## TYPE ## _seq *seq = (SEQ); /* avoid variable capture */ \
for (i = (START); i < asdl_seq_LEN(seq); i++) { \
TYPE ## _ty elt = (TYPE ## _ty)asdl_seq_GET(seq, i); \
@@ -1916,7 +1916,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
VISIT_SEQ(st, alias, s->v.ImportFrom.names);
break;
case Global_kind: {
- int i;
+ Py_ssize_t i;
asdl_identifier_seq *seq = s->v.Global.names;
for (i = 0; i < asdl_seq_LEN(seq); i++) {
identifier name = (identifier)asdl_seq_GET(seq, i);
@@ -1952,7 +1952,7 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
break;
}
case Nonlocal_kind: {
- int i;
+ Py_ssize_t i;
asdl_identifier_seq *seq = s->v.Nonlocal.names;
for (i = 0; i < asdl_seq_LEN(seq); i++) {
identifier name = (identifier)asdl_seq_GET(seq, i);
@@ -2494,7 +2494,7 @@ symtable_implicit_arg(struct symtable *st, int pos)
static int
symtable_visit_params(struct symtable *st, asdl_arg_seq *args)
{
- int i;
+ Py_ssize_t i;
if (!args)
return -1;
@@ -2555,7 +2555,7 @@ symtable_visit_annotation(struct symtable *st, expr_ty annotation, void *key)
static int
symtable_visit_argannotations(struct symtable *st, asdl_arg_seq *args)
{
- int i;
+ Py_ssize_t i;
if (!args)
return -1;