diff --git a/python/google/protobuf/pyext/unknown_fields.cc b/python/google/protobuf/pyext/unknown_fields.cc index b9ca6ad3b0f31..6d919b361ad94 100644 --- a/python/google/protobuf/pyext/unknown_fields.cc +++ b/python/google/protobuf/pyext/unknown_fields.cc @@ -219,7 +219,7 @@ const UnknownField* GetUnknownField(PyUnknownFieldRef* self) { "The parent message might be cleared."); return NULL; } - ssize_t total_size = fields->field_count(); + Py_ssize_t total_size = fields->field_count(); if (self->index >= total_size) { PyErr_Format(PyExc_ValueError, "UnknownField does not exist. "