mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
PyTuple_SetItem should require that the tuple's refcnt is one!
This commit is contained in:
parent
607b33a1fe
commit
787bdd37a0
1 changed files with 1 additions and 1 deletions
|
@ -133,7 +133,7 @@ PyTuple_SetItem(op, i, newitem)
|
||||||
{
|
{
|
||||||
register PyObject *olditem;
|
register PyObject *olditem;
|
||||||
register PyObject **p;
|
register PyObject **p;
|
||||||
if (!PyTuple_Check(op)) {
|
if (!PyTuple_Check(op) || op->ob_refcnt != 1) {
|
||||||
Py_XDECREF(newitem);
|
Py_XDECREF(newitem);
|
||||||
PyErr_BadInternalCall();
|
PyErr_BadInternalCall();
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue