[Python-checkins] r46409 - in python/trunk: Modules/_ctypes/_ctypes.c Python/ast.c Python/compile.c

georg.brandl python-checkins at python.org
Fri May 26 22:04:45 CEST 2006


Author: georg.brandl
Date: Fri May 26 22:04:44 2006
New Revision: 46409

Modified:
   python/trunk/Modules/_ctypes/_ctypes.c
   python/trunk/Python/ast.c
   python/trunk/Python/compile.c
Log:
Replace Py_BuildValue("OO") by PyTuple_Pack.



Modified: python/trunk/Modules/_ctypes/_ctypes.c
==============================================================================
--- python/trunk/Modules/_ctypes/_ctypes.c	(original)
+++ python/trunk/Modules/_ctypes/_ctypes.c	Fri May 26 22:04:44 2006
@@ -2185,7 +2185,7 @@
 		  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",

Modified: python/trunk/Python/ast.c
==============================================================================
--- python/trunk/Python/ast.c	(original)
+++ python/trunk/Python/ast.c	Fri May 26 22:04:44 2006
@@ -107,7 +107,7 @@
 	Py_DECREF(errstr);
 	return;
     }
-    value = Py_BuildValue("(OO)", errstr, tmp);
+    value = PyTuple_Pack(2, errstr, tmp);
     Py_DECREF(errstr);
     Py_DECREF(tmp);
     if (!value)

Modified: python/trunk/Python/compile.c
==============================================================================
--- python/trunk/Python/compile.c	(original)
+++ python/trunk/Python/compile.c	Fri May 26 22:04:44 2006
@@ -334,7 +334,7 @@
 			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 @@
 				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 @@
 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);


More information about the Python-checkins mailing list