Skip to content

Commit d7787ec

Browse files
author
unknown
committed
add log
1 parent f69c337 commit d7787ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pyCall.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ const char *callWrapperError(int ret)
1414
return errStrMap[ret].c_str();
1515
}
1616
spdlog::error("wrapper Error,ret:{}", ret);
17-
//PyGILState_STATE gstate = PyGILState_Ensure();
17+
std::cout<<"wrapper error"<<ret<<std::endl;
18+
PyGILState_STATE gstate = PyGILState_Ensure();
1819
PyObject *wrapperModule = PyImport_ImportModule(_wrapperName);
1920
PyObject *errFunc = PyObject_GetAttrString(wrapperModule, "wrapperError");
2021
if (!errFunc || !PyCallable_Check(errFunc))
2122
{
2223
std::cout << log_python_exception << std::endl;
23-
//PyGILState_Release(gstate);
24+
PyGILState_Release(gstate);
2425
return "wrapperError func need to implement";
2526
}
2627
PyObject *pArgsT = PyTuple_New(1);
@@ -62,7 +63,7 @@ const char *callWrapperError(int ret)
6263
Py_XDECREF(pArgsT);
6364
Py_DECREF(errFunc);
6465
Py_XDECREF(wrapperModule);
65-
//PyGILState_Release(gstate);
66+
PyGILState_Release(gstate);
6667
return errStrMap[ret].c_str();
6768
}
6869

0 commit comments

Comments
 (0)