Commit 9171f021 authored by Martin v. Löwis's avatar Martin v. Löwis

Synchronize with PyXML 1.79:

73: Restore support for Python 2.1.
74: Factor the previous change differently
79: Conditionalize usage of PyTuple_Pack.
parent 3e73a011
...@@ -338,7 +338,11 @@ trace_frame_exc(PyThreadState *tstate, PyFrameObject *f) ...@@ -338,7 +338,11 @@ trace_frame_exc(PyThreadState *tstate, PyFrameObject *f)
value = Py_None; value = Py_None;
Py_INCREF(value); Py_INCREF(value);
} }
#if PY_VERSION_HEX < 0x02040000
arg = Py_BuildValue("(OOO)", type, value, traceback);
#else
arg = PyTuple_Pack(3, type, value, traceback); arg = PyTuple_Pack(3, type, value, traceback);
#endif
if (arg == NULL) { if (arg == NULL) {
PyErr_Restore(type, value, traceback); PyErr_Restore(type, value, traceback);
return 0; return 0;
...@@ -936,7 +940,12 @@ readinst(char *buf, int buf_size, PyObject *meth) ...@@ -936,7 +940,12 @@ readinst(char *buf, int buf_size, PyObject *meth)
PyTuple_SET_ITEM(arg, 0, bytes); 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; goto finally;
/* XXX what to do if it returns a Unicode string? */ /* XXX what to do if it returns a Unicode string? */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment