]> granicus.if.org Git - python/commitdiff
Replace Py_BuildValue("OO") by PyTuple_Pack.
authorGeorg Brandl <georg@python.org>
Fri, 26 May 2006 20:04:44 +0000 (20:04 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 26 May 2006 20:04:44 +0000 (20:04 +0000)
Modules/_ctypes/_ctypes.c
Python/ast.c
Python/compile.c

index 6a2783300129ba7fab6c6ea20bb7377ee8e9a7c2..6bb0880f06df3b5668247790c6039a807c0aa670 100644 (file)
@@ -2185,7 +2185,7 @@ _CData_set(CDataObject *dst, PyObject *type, SETFUNC setfunc, PyObject *value,
                  only it's object list.  So we create a tuple, containing
                  b_objects list PLUS the array itself, and return that!
                */
-               return Py_BuildValue("(OO)", keep, value);
+               return PyTuple_Pack(2, keep, value);
        }
        PyErr_Format(PyExc_TypeError,
                     "incompatible types, %s instance instead of %s instance",
index 96645900552dd644ba2a198ac810d8f9357a550b..f3e611b8e375576feeea115420df2dd4cceb0bf2 100644 (file)
@@ -107,7 +107,7 @@ ast_error_finish(const char *filename)
        Py_DECREF(errstr);
        return;
     }
-    value = Py_BuildValue("(OO)", errstr, tmp);
+    value = PyTuple_Pack(2, errstr, tmp);
     Py_DECREF(errstr);
     Py_DECREF(tmp);
     if (!value)
index 15e7e158118f9c19d3ec8f793bc622f898e98161..e555fec925236e9cb3d0467928d73341aa110fef 100644 (file)
@@ -334,7 +334,7 @@ list2dict(PyObject *list)
                        return NULL;
                }
                k = PyList_GET_ITEM(list, i);
-               k = Py_BuildValue("(OO)", k, k->ob_type);
+               k = PyTuple_Pack(2, k, k->ob_type);
                if (k == NULL || PyDict_SetItem(dict, k, v) < 0) {
                        Py_XDECREF(k);
                        Py_DECREF(v);
@@ -377,7 +377,7 @@ dictbytype(PyObject *src, int scope_type, int flag, int offset)
                                return NULL;
                        }
                        i++;
-                       tuple = Py_BuildValue("(OO)", k, k->ob_type);
+                       tuple = PyTuple_Pack(2, k, k->ob_type);
                        if (!tuple || PyDict_SetItem(dest, tuple, item) < 0) {
                                Py_DECREF(item);
                                Py_DECREF(dest);
@@ -1841,7 +1841,7 @@ static int
 compiler_lookup_arg(PyObject *dict, PyObject *name)
 {
     PyObject *k, *v;
-    k = Py_BuildValue("(OO)", name, name->ob_type);
+    k = PyTuple_Pack(2, name, name->ob_type);
     if (k == NULL)
        return -1;
     v = PyDict_GetItem(dict, k);