Skip to content

Commit 7015a61

Browse files
committed
Fix GCC compiler errors in cpyext tests.
1 parent b20f203 commit 7015a61

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

graalpython/com.oracle.graal.python.test/src/tests/cpyext/test_abstract.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,8 @@ def compile_module(self, name):
517517
(iter({'a':0,'b':1,'c':2}),2)
518518
),
519519
code='''PyObject* wrap_PyIter_Next(PyObject* iter, int n) {
520-
for (int i = 0; i < n - 1; i++) {
520+
int i;
521+
for (i = 0; i < n - 1; i++) {
521522
PyIter_Next(iter);
522523
}
523524
return PyIter_Next(iter);

graalpython/com.oracle.graal.python.test/src/tests/cpyext/test_list.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ def compile_module(self, name):
162162
),
163163
code='''PyObject* wrap_PyList_SetItem(Py_ssize_t capacity, Py_ssize_t idx, PyObject* new_item) {
164164
PyObject *newList = PyList_New(capacity);
165-
for (Py_ssize_t i = 0; i < capacity; i++) {
165+
Py_ssize_t i;
166+
for (i = 0; i < capacity; i++) {
166167
if (i == idx) {
167168
PyList_SetItem(newList, i, new_item);
168169
} else {

0 commit comments

Comments
 (0)