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:
@@ -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
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user