diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-14 06:11:58 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-14 06:11:58 -0500 |
commit | aa3bade0506f2dba066da9adff1d747635d0e118 (patch) | |
tree | 135d236d037667ef060a1e01181fc3f8b9f50303 /src/pyinterp.cc | |
parent | 3bec708e384290b714b3f5735904927f4755e39a (diff) | |
download | fork-ledger-aa3bade0506f2dba066da9adff1d747635d0e118.tar.gz fork-ledger-aa3bade0506f2dba066da9adff1d747635d0e118.tar.bz2 fork-ledger-aa3bade0506f2dba066da9adff1d747635d0e118.zip |
Added another catch handler for Python exceptions
Diffstat (limited to 'src/pyinterp.cc')
-rw-r--r-- | src/pyinterp.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pyinterp.cc b/src/pyinterp.cc index 0a56049c..0701176f 100644 --- a/src/pyinterp.cc +++ b/src/pyinterp.cc @@ -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]; |