Skip to content

Commit ed2682b

Browse files
author
Victor Stinner
committed
Reuse PyUnicode_Copy() in validate_and_copy_tuple()
1 parent beac78b commit ed2682b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Objects/codeobject.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,7 @@ validate_and_copy_tuple(PyObject *tup)
249249
return NULL;
250250
}
251251
else {
252-
item = PyUnicode_FromUnicode(
253-
PyUnicode_AS_UNICODE(item),
254-
PyUnicode_GET_SIZE(item));
252+
item = PyUnicode_Copy(item);
255253
if (item == NULL) {
256254
Py_DECREF(newtuple);
257255
return NULL;

0 commit comments

Comments
 (0)