diff -r d9337fe963cc Objects/tupleobject.c --- a/Objects/tupleobject.c Thu Apr 03 08:01:44 2014 -0700 +++ b/Objects/tupleobject.c Thu Apr 03 20:26:07 2014 +0200 @@ -63,10 +63,9 @@ } PyObject * -PyTuple_New(Py_ssize_t size) +_PyTuple_New(Py_ssize_t size) { PyTupleObject *op; - Py_ssize_t i; if (size < 0) { PyErr_BadInternalCall(); return NULL; @@ -105,8 +104,6 @@ if (op == NULL) return NULL; } - for (i=0; i < size; i++) - op->ob_item[i] = NULL; #if PyTuple_MAXSAVESIZE > 0 if (size == 0) { free_list[0] = op; @@ -121,6 +118,19 @@ return (PyObject *) op; } +PyObject * +PyTuple_New(Py_ssize_t size) +{ + PyTupleObject * op = _PyTuple_New(size); + Py_ssize_t i; + if (op == NULL) { + return NULL; + } + for (i=0; i < size; i++) + op->ob_item[i] = NULL; + return op; +} + Py_ssize_t PyTuple_Size(PyObject *op) { @@ -205,7 +215,7 @@ va_list vargs; va_start(vargs, n); - result = PyTuple_New(n); + result = _PyTuple_New(n); if (result == NULL) { va_end(vargs); return NULL; diff -r d9337fe963cc Python/ceval.c --- a/Python/ceval.c Thu Apr 03 08:01:44 2014 -0700 +++ b/Python/ceval.c Thu Apr 03 20:26:07 2014 +0200 @@ -15,6 +15,7 @@ #include "frameobject.h" #include "opcode.h" #include "structmember.h" +PyObject * _PyTuple_New(Py_ssize_t size); #include @@ -2323,7 +2324,7 @@ } TARGET(BUILD_TUPLE) { - PyObject *tup = PyTuple_New(oparg); + PyObject *tup = _PyTuple_New(oparg); if (tup == NULL) goto error; while (--oparg >= 0) {