diff --git a/python/map.c b/python/map.c index 4b6e97e193..1e2b3806b6 100644 --- a/python/map.c +++ b/python/map.c @@ -259,16 +259,6 @@ static Py_ssize_t PyUpb_MapContainer_Length(PyObject* _self) { return map ? upb_Map_Size(map) : 0; } -static PyUpb_MapContainer* PyUpb_MapContainer_Check(PyObject* _self) { - PyUpb_ModuleState* state = PyUpb_ModuleState_Get(); - if (!PyObject_TypeCheck(_self, state->message_map_container_type) && - !PyObject_TypeCheck(_self, state->scalar_map_container_type)) { - PyErr_Format(PyExc_TypeError, "Expected protobuf map, but got %R", _self); - return NULL; - } - return (PyUpb_MapContainer*)_self; -} - int PyUpb_Message_InitMapAttributes(PyObject* map, PyObject* value, const upb_FieldDef* f); diff --git a/python/message.c b/python/message.c index f31aa5e734..8d91b0fe4e 100644 --- a/python/message.c +++ b/python/message.c @@ -1665,7 +1665,6 @@ static PyObject* PyUpb_Message_WhichOneof(PyObject* _self, PyObject* name) { } PyObject* DeepCopy(PyObject* _self, PyObject* arg) { - PyUpb_Message* self = (void*)_self; const upb_MessageDef* def = PyUpb_Message_GetMsgdef(_self); const upb_MiniTable* mini_table = upb_MessageDef_MiniTable(def); upb_Message* msg = PyUpb_Message_GetIfReified(_self); diff --git a/python/protobuf.c b/python/protobuf.c index 316b1f6603..82b690ea3f 100644 --- a/python/protobuf.c +++ b/python/protobuf.c @@ -216,7 +216,7 @@ typedef struct { // memory to the OS. Without this call, we appear to leak memory, at least // as measured in RSS. // -// We opt not to use this instead of PyMalloc (which would also solve the +// We opt to use this instead of PyMalloc (which would also solve the // problem) because the latter requires the GIL to be held. This would make // our messages unsafe to share with other languages that could free at // unpredictable @@ -240,7 +240,7 @@ static void* upb_trim_allocfunc(upb_alloc* alloc, void* ptr, size_t oldsize, } } static upb_alloc trim_alloc = {&upb_trim_allocfunc}; -static const upb_alloc* global_alloc = &trim_alloc; +static upb_alloc* global_alloc = &trim_alloc; // end:github_only static upb_Arena* PyUpb_NewArena(void) {