diff Python/import.c @ 38314:1fdf29a88f0e legacy-trunk

Replace PyObject_CallFunction calls with only object args with PyObject_CallFunctionObjArgs, which is 30% faster.
author Georg Brandl <georg@python.org>
date Thu, 25 May 2006 19:15:31 +0000
parents b5e7d5b3c442
children d21896b2dd0a
line wrap: on
line diff
--- a/Python/import.c	Thu May 25 19:15:27 2006 +0000
+++ b/Python/import.c	Thu May 25 19:15:31 2006 +0000
@@ -1043,7 +1043,7 @@
 		PyObject *hook = PyList_GetItem(path_hooks, j);
 		if (hook == NULL)
 			return NULL;
-		importer = PyObject_CallFunction(hook, "O", p);
+		importer = PyObject_CallFunctionObjArgs(hook, p, NULL);
 		if (importer != NULL)
 			break;
 
@@ -2499,8 +2499,8 @@
 		goto err;
 
 	/* Call the _import__ function with the proper argument list */
-	r = PyObject_CallFunction(import, "OOOO",
-				  module_name, globals, globals, silly_list);
+	r = PyObject_CallFunctionObjArgs(import, module_name, globals,
+					 globals, silly_list, NULL);
 
   err:
 	Py_XDECREF(globals);