From 98a4b1983eb9b985e48112209179b94b853c74f8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 2 Oct 2015 11:13:43 +0530 Subject: [PATCH] Fix some compiler warnings --- src/duktape/errors.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/duktape/errors.c b/src/duktape/errors.c index 5c2b969119..3df2ea61c8 100644 --- a/src/duktape/errors.c +++ b/src/duktape/errors.c @@ -19,7 +19,6 @@ static int copy_error_attr(PyObject *obj, const char* name, PyObject *dest) { void set_dukpy_error(PyObject *obj) { PyObject *err = NULL, *iterator = NULL, *item = NULL; - Py_ssize_t i = 0; if (Py_TYPE(obj) == &DukObject_Type) { err = PyDict_New(); if (err == NULL) { PyErr_NoMemory(); return; } @@ -34,7 +33,7 @@ void set_dukpy_error(PyObject *obj) { // Now copy over own properties iterator = PyObject_CallMethod(obj, "items", NULL); if (iterator == NULL) { Py_DECREF(err); return; } - while (item = PyIter_Next(iterator)) { + while ((item = PyIter_Next(iterator))) { PyDict_SetItem(err, PyTuple_GET_ITEM(item, 0), PyTuple_GET_ITEM(item, 1)); Py_DECREF(item); }