mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
PyList_Reverse(): This was leaking a reference to Py_None on every call.
I believe I introduced this bug when I refactored the reversal code so that the mergesort could use it too. It's not a problem on the 2.2 branch.
This commit is contained in:
parent
443fec3dd9
commit
6063e2615f
1 changed files with 4 additions and 1 deletions
|
@ -1718,11 +1718,14 @@ listreverse(PyListObject *self)
|
||||||
int
|
int
|
||||||
PyList_Reverse(PyObject *v)
|
PyList_Reverse(PyObject *v)
|
||||||
{
|
{
|
||||||
|
PyListObject *self = (PyListObject *)v;
|
||||||
|
|
||||||
if (v == NULL || !PyList_Check(v)) {
|
if (v == NULL || !PyList_Check(v)) {
|
||||||
PyErr_BadInternalCall();
|
PyErr_BadInternalCall();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
listreverse((PyListObject *)v);
|
if (self->ob_size > 1)
|
||||||
|
reverse_slice(self->ob_item, self->ob_item + self->ob_size);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue