[Python-checkins] r62290 - python/trunk/Modules/_ctypes/_ctypes.c

thomas.heller python-checkins at python.org
Fri Apr 11 16:20:27 CEST 2008


Author: thomas.heller
Date: Fri Apr 11 16:20:26 2008
New Revision: 62290

Modified:
   python/trunk/Modules/_ctypes/_ctypes.c
Log:
Performance improvements.


Modified: python/trunk/Modules/_ctypes/_ctypes.c
==============================================================================
--- python/trunk/Modules/_ctypes/_ctypes.c	(original)
+++ python/trunk/Modules/_ctypes/_ctypes.c	Fri Apr 11 16:20:26 2008
@@ -2205,7 +2205,7 @@
 		return 0;
 	}
 	ob = CData_GetContainer(target);
-	if (ob->b_objects == NULL || !PyDict_Check(ob->b_objects)) {
+	if (ob->b_objects == NULL || !PyDict_CheckExact(ob->b_objects)) {
 		Py_XDECREF(ob->b_objects);
 		ob->b_objects = keep; /* refcount consumed */
 		return 0;
@@ -4686,7 +4686,7 @@
 {
 	PyObject *value = NULL;
 
-	if (!PyArg_ParseTuple(args, "|O:POINTER", &value))
+	if (!PyArg_UnpackTuple(args, "POINTER", 0, 1, &value))
 		return -1;
 	if (value == NULL)
 		return 0;
@@ -5121,7 +5121,7 @@
 		}
 		Py_XINCREF(obj->b_objects);
 		result->b_objects = obj->b_objects;
-		if (result->b_objects && PyDict_Check(result->b_objects)) {
+		if (result->b_objects && PyDict_CheckExact(result->b_objects)) {
 			PyObject *index;
 			int rc;
 			index = PyLong_FromVoidPtr((void *)src);


More information about the Python-checkins mailing list