summaryrefslogtreecommitdiffstats
path: root/Objects/tupleobject.c
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2001-05-29 07:58:45 (GMT)
committerThomas Wouters <thomas@python.org>2001-05-29 07:58:45 (GMT)
commit0dcea5973dd91d6ecbeae2b93441ec67f6ba06aa (patch)
tree07b7381ffcda27fbbd5c165f21356f56a011b515 /Objects/tupleobject.c
parent3a2ab1ab69b1899964066b682d721d172c681d20 (diff)
downloadcpython-0dcea5973dd91d6ecbeae2b93441ec67f6ba06aa.zip
cpython-0dcea5973dd91d6ecbeae2b93441ec67f6ba06aa.tar.gz
cpython-0dcea5973dd91d6ecbeae2b93441ec67f6ba06aa.tar.bz2
_PyTuple_Resize: guard against PyTuple_New() returning NULL, using Tim's
suggestion (modulo style).
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r--Objects/tupleobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 94f1859..17ec1a0 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -516,7 +516,7 @@ _PyTuple_Resize(PyObject **pv, int newsize)
(current) reference */
Py_DECREF(v);
*pv = PyTuple_New(newsize);
- return 0;
+ return *pv == NULL ? -1 : 0;
}
/* XXX UNREF/NEWREF interface should be more symmetrical */