diff --git a/src/Base/Interpreter.cpp b/src/Base/Interpreter.cpp index 21d78b292..37900bc62 100644 --- a/src/Base/Interpreter.cpp +++ b/src/Base/Interpreter.cpp @@ -214,7 +214,7 @@ std::string InterpreterSingleton::runString(const char *sCmd) } } -Py::Object InterpreterSingleton::runString_returnObject(const char *sCmd) +Py::Object InterpreterSingleton::runStringObject(const char *sCmd) { PyObject *module, *dict, *presult; /* "exec code in d, d" */ @@ -235,7 +235,7 @@ Py::Object InterpreterSingleton::runString_returnObject(const char *sCmd) throw PyException(); } - return Py::Object(presult, true); + return Py::asObject(presult); } void InterpreterSingleton::systemExit(void) diff --git a/src/Base/Interpreter.h b/src/Base/Interpreter.h index c0793a433..6357f6200 100644 --- a/src/Base/Interpreter.h +++ b/src/Base/Interpreter.h @@ -161,8 +161,8 @@ public: //@{ /// Run a statement on the python interpreter and gives back a string with the representation of the result. std::string runString(const char *psCmd); - /// Runs a string (expression) and returns object returned by expression. - Py::Object runString_returnObject(const char *sCmd); + /// Run a statement on the python interpreter and return back the result object. + Py::Object runStringObject(const char *sCmd); /// Run a statement on the python interpreter and gives back a string with the representation of the result. void runInteractiveString(const char *psCmd); /// Run file (script) on the python interpreter diff --git a/src/Mod/Part/Gui/AppPartGui.cpp b/src/Mod/Part/Gui/AppPartGui.cpp index 8f49e1cac..bae44f7ae 100644 --- a/src/Mod/Part/Gui/AppPartGui.cpp +++ b/src/Mod/Part/Gui/AppPartGui.cpp @@ -182,7 +182,7 @@ PyMODINIT_FUNC initPartGui() CreateSimplePartCommands(); CreateParamPartCommands(); try{ - Py::Object ae = Base::Interpreter().runString_returnObject("__import__('AttachmentEditor.Commands').Commands"); + Py::Object ae = Base::Interpreter().runStringObject("__import__('AttachmentEditor.Commands').Commands"); Py::Module(partGuiModule).setAttr(std::string("AttachmentEditor"),ae); } catch (Base::PyException &err){ err.ReportException();