Skip to content
Snippets Groups Projects
Commit 0c0b6ca9 authored by dmitriy.gerasimov's avatar dmitriy.gerasimov
Browse files

Merge branch 'fix_cmdfunc_for_pyhton' into 'master'

Fix python function call when processing cli command created from Python.

See merge request !75
parents c68ba504 b96f22da
No related branches found
No related tags found
1 merge request!75Fix python function call when processing cli command created from Python.
...@@ -100,6 +100,7 @@ void element_py_func_del_all(){ ...@@ -100,6 +100,7 @@ void element_py_func_del_all(){
} }
static int wrapping_cmdfunc(int argc, char **argv, char **str_reply){ static int wrapping_cmdfunc(int argc, char **argv, char **str_reply){
PyGILState_STATE state = PyGILState_Ensure();
size_t id_str_replay = elements_str_reply_add(str_reply); size_t id_str_replay = elements_str_reply_add(str_reply);
PyObject *obj_argv = stringToPyList(argc, argv); PyObject *obj_argv = stringToPyList(argc, argv);
PyObject *obj_id_str_replay = PyLong_FromSize_t(id_str_replay); PyObject *obj_id_str_replay = PyLong_FromSize_t(id_str_replay);
...@@ -114,6 +115,7 @@ static int wrapping_cmdfunc(int argc, char **argv, char **str_reply){ ...@@ -114,6 +115,7 @@ static int wrapping_cmdfunc(int argc, char **argv, char **str_reply){
Py_XDECREF(arglist); Py_XDECREF(arglist);
Py_XDECREF(obj_argv); Py_XDECREF(obj_argv);
elements_str_reply_delete(id_str_replay); elements_str_reply_delete(id_str_replay);
PyGILState_Release(state);
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment