diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-08-14 07:23:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-08-14 07:23:36 +0400 |
commit | 3f2cb6e87855e4afc2e26d87f36817a92490429e (patch) | |
tree | 8c9af32f0aa1e42a08cc6d9d2aac3f1c6c052535 /source/gameengine/Expressions/InputParser.cpp | |
parent | d2750f7bda1e5e4e43df330ab49e677105e00d4f (diff) |
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
Diffstat (limited to 'source/gameengine/Expressions/InputParser.cpp')
-rw-r--r-- | source/gameengine/Expressions/InputParser.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp index 24033dd21a2..32a9de32e21 100644 --- a/source/gameengine/Expressions/InputParser.cpp +++ b/source/gameengine/Expressions/InputParser.cpp @@ -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 }; |