]> granicus.if.org Git - python/commitdiff
Reuse PyUnicode_Copy() in validate_and_copy_tuple()
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 11 Oct 2011 19:53:24 +0000 (21:53 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 11 Oct 2011 19:53:24 +0000 (21:53 +0200)
Objects/codeobject.c

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