Skip to content

Commit 68c31c4

Browse files
committed
BPO-41085: Fixed 'array.array.index' downcasting 'Py_ssize_t' to 'long'.
1 parent b4e85ca commit 68c31c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/arraymodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ array_array_index(arrayobject *self, PyObject *v)
11301130
cmp = PyObject_RichCompareBool(selfi, v, Py_EQ);
11311131
Py_DECREF(selfi);
11321132
if (cmp > 0) {
1133-
return PyLong_FromLong((long)i);
1133+
return PyLong_FromSsize_t(i);
11341134
}
11351135
else if (cmp < 0)
11361136
return NULL;

0 commit comments

Comments
 (0)