summaryrefslogtreecommitdiff
path: root/Modules/pyexpat.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2004-10-13 19:50:11 +0000
committerMartin v. Löwis <martin@v.loewis.de>2004-10-13 19:50:11 +0000
commit871cb9e426543902e5c57006655830b2e122552d (patch)
treedda45582b99e7fbf33565426b9cced80e4873d81 /Modules/pyexpat.c
parent7ee02c5774c4da1fba18c812080ec3bcfe3fc8c2 (diff)
downloadcpython-871cb9e426543902e5c57006655830b2e122552d.tar.gz
Synchronize with PyXML 1.79:
73: Restore support for Python 2.1. 74: Factor the previous change differently 79: Conditionalize usage of PyTuple_Pack.
Diffstat (limited to 'Modules/pyexpat.c')
-rw-r--r--Modules/pyexpat.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index d5929b6996..d359a7405c 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -338,7 +338,11 @@ trace_frame_exc(PyThreadState *tstate, PyFrameObject *f)
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 @@ readinst(char *buf, int buf_size, PyObject *meth)
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? */