Added another catch handler for Python exceptions
This commit is contained in:
parent
3bec708e38
commit
aa3bade050
1 changed files with 4 additions and 0 deletions
|
|
@ -296,6 +296,10 @@ value_t python_interpreter_t::python_command(call_scope_t& args)
|
|||
try {
|
||||
status = Py_Main(static_cast<int>(args.size()) + 1, argv);
|
||||
}
|
||||
catch (const error_already_set&) {
|
||||
PyErr_Print();
|
||||
throw_(std::runtime_error, _("Failed to execute Python module"));
|
||||
}
|
||||
catch (...) {
|
||||
for (std::size_t i = 0; i < args.size() + 1; i++)
|
||||
delete[] argv[i];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue