From aa3bade0506f2dba066da9adff1d747635d0e118 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 14 Nov 2009 06:11:58 -0500 Subject: Added another catch handler for Python exceptions --- src/pyinterp.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pyinterp.cc') 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(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]; -- cgit v1.2.3