diff options
author | Thomas Wouters <thomas@python.org> | 2001-05-29 07:58:45 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2001-05-29 07:58:45 (GMT) |
commit | 0dcea5973dd91d6ecbeae2b93441ec67f6ba06aa (patch) | |
tree | 07b7381ffcda27fbbd5c165f21356f56a011b515 /Objects/tupleobject.c | |
parent | 3a2ab1ab69b1899964066b682d721d172c681d20 (diff) | |
download | cpython-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.c | 2 |
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 */ |