diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc index a8248888f7..df04381822 100644 --- a/python/google/protobuf/pyext/message.cc +++ b/python/google/protobuf/pyext/message.cc @@ -2140,7 +2140,7 @@ static PyObject* ListFields(CMessage* self) { PyList_SET_ITEM(all_fields.get(), actual_size, t.release()); ++actual_size; } - if (actual_size != fields.size() && + if (static_cast(actual_size) != fields.size() && (PyList_SetSlice(all_fields.get(), actual_size, fields.size(), NULL) < 0)) { return NULL;