Commit 9945cdf2 authored by Toby Dickenson's avatar Toby Dickenson

avoid using PyObject_CallFunction when a single parameter may be a tuple

parent efd87296
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
****************************************************************************/ ****************************************************************************/
static char cDocumentTemplate_module_documentation[] = static char cDocumentTemplate_module_documentation[] =
"" ""
"\n$Id: cDocumentTemplate.c,v 1.45 2002/04/25 12:45:11 htrd Exp $" "\n$Id: cDocumentTemplate.c,v 1.46 2002/05/09 13:19:17 htrd Exp $"
; ;
#include "ExtensionClass.h" #include "ExtensionClass.h"
...@@ -663,7 +663,7 @@ static int ...@@ -663,7 +663,7 @@ static int
render_blocks_(PyObject *blocks, PyObject *rendered, render_blocks_(PyObject *blocks, PyObject *rendered,
PyObject *md, PyObject *mda) PyObject *md, PyObject *mda)
{ {
PyObject *block, *t; PyObject *block, *t, *args;
int l, i, k=0, append; int l, i, k=0, append;
if ((l=PyList_Size(blocks)) < 0) return -1; if ((l=PyList_Size(blocks)) < 0) return -1;
...@@ -691,7 +691,12 @@ render_blocks_(PyObject *blocks, PyObject *rendered, ...@@ -691,7 +691,12 @@ render_blocks_(PyObject *blocks, PyObject *rendered,
if (! ( PyString_Check(t) || PyUnicode_Check(t) ) ) if (! ( PyString_Check(t) || PyUnicode_Check(t) ) )
{ {
ASSIGN(t, PyObject_CallFunction(ustr, "O", t)); args = PyTuple_New(1);
if(!args) return -1;
PyTuple_SET_ITEM(args,0,t);
t = PyObject_CallObject(ustr, args);
Py_DECREF(args);
args = NULL;
UNLESS(t) return -1; UNLESS(t) return -1;
} }
......
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