game engine python api

* removed macros that were not used much, some misleading.
* removed error string setting calls that overwrote the error set by PyArg_ParseTuple with a less useful one.
* use python macros Py_RETURN_NONE, Py_RETURN_TRUE, Py_RETURN_FALSE
This commit is contained in:
Campbell Barton
2008-08-14 03:23:36 +00:00
parent d2750f7bda
commit 3f2cb6e878
20 changed files with 100 additions and 212 deletions

View File

@@ -631,7 +631,8 @@ void CParser::SetContext(CValue* context)
PyObject* CParserPyMake(PyObject* ignored,PyObject* args)
{
char* txt;
Py_Try(PyArg_ParseTuple(args,"s",&txt));
if (!PyArg_ParseTuple(args,"s",&txt))
return NULL;
CParser parser;
CExpression* expr = parser.ProcessText(txt);
CValue* val = expr->Calculate();
@@ -641,7 +642,7 @@ PyObject* CParserPyMake(PyObject* ignored,PyObject* args)
static PyMethodDef CParserMethods[] =
{
{ "calc", CParserPyMake , Py_NEWARGS},
{ "calc", CParserPyMake , METH_VARARGS},
{ NULL,NULL} // Sentinel
};