Reuse PyUnicode_Copy() in validate_and_copy_tuple()

This commit is contained in:
Victor Stinner 2011-10-11 21:53:24 +02:00
parent beac78bb24
commit ed2682be2f

View file

@ -249,9 +249,7 @@ validate_and_copy_tuple(PyObject *tup)
return NULL; return NULL;
} }
else { else {
item = PyUnicode_FromUnicode( item = PyUnicode_Copy(item);
PyUnicode_AS_UNICODE(item),
PyUnicode_GET_SIZE(item));
if (item == NULL) { if (item == NULL) {
Py_DECREF(newtuple); Py_DECREF(newtuple);
return NULL; return NULL;