[Python-checkins] python/dist/src/Modules pyexpat.c,2.88,2.89

loewis at users.sourceforge.net loewis at users.sourceforge.net
Wed Oct 13 21:50:13 CEST 2004


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8030

Modified Files:
	pyexpat.c 
Log Message:
Synchronize with PyXML 1.79:
73: Restore support for Python 2.1.
74: Factor the previous change differently
79: Conditionalize usage of PyTuple_Pack.


Index: pyexpat.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/pyexpat.c,v
retrieving revision 2.88
retrieving revision 2.89
diff -u -d -r2.88 -r2.89
--- pyexpat.c	26 Aug 2004 00:37:31 -0000	2.88
+++ pyexpat.c	13 Oct 2004 19:50:11 -0000	2.89
@@ -338,7 +338,11 @@
 	value = Py_None;
 	Py_INCREF(value);
     }
+#if PY_VERSION_HEX < 0x02040000
+    arg = Py_BuildValue("(OOO)", type, value, traceback);
+#else
     arg = PyTuple_Pack(3, type, value, traceback);
+#endif
     if (arg == NULL) {
 	PyErr_Restore(type, value, traceback);
 	return 0;
@@ -936,7 +940,12 @@
 
     PyTuple_SET_ITEM(arg, 0, bytes);
 
-    if ((str = PyObject_Call(meth, arg, NULL)) == NULL)
+#if PY_VERSION_HEX < 0x02020000
+    str = PyObject_CallObject(meth, arg);
+#else
+    str = PyObject_Call(meth, arg, NULL);
+#endif
+    if (str == NULL)
         goto finally;
 
     /* XXX what to do if it returns a Unicode string? */



More information about the Python-checkins mailing list