summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/tupleobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 0faedb4..d6fb6b4 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -133,7 +133,7 @@ PyTuple_SetItem(op, i, newitem)
{
register PyObject *olditem;
register PyObject **p;
- if (!PyTuple_Check(op)) {
+ if (!PyTuple_Check(op) || op->ob_refcnt != 1) {
Py_XDECREF(newitem);
PyErr_BadInternalCall();
return -1;