Commit dddc26d5 authored by Boxiang Sun's avatar Boxiang Sun

if the argument of MM_pop is not NULL but an empty tuple, don't unpack it

parent 3e0cf473
...@@ -231,7 +231,7 @@ MM_pop(MM *self, PyObject *args) ...@@ -231,7 +231,7 @@ MM_pop(MM *self, PyObject *args)
int i=1, l; int i=1, l;
PyObject *r; PyObject *r;
if (args) UNLESS(PyArg_ParseTuple(args, "i", &i)) return NULL; if (args && PyTuple_Size(args) != 0) UNLESS(PyArg_ParseTuple(args, "i", &i)) return NULL;
if ((l=PyList_Size(self->data)) < 0) return NULL; if ((l=PyList_Size(self->data)) < 0) return NULL;
i=l-i; i=l-i;
UNLESS(r=PySequence_GetItem(self->data,l-1)) return NULL; UNLESS(r=PySequence_GetItem(self->data,l-1)) return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment