diff --git a/src/libcalamares/python/PythonJob.cpp b/src/libcalamares/python/PythonJob.cpp index c273b468a..4f00ca7fe 100644 --- a/src/libcalamares/python/PythonJob.cpp +++ b/src/libcalamares/python/PythonJob.cpp @@ -240,12 +240,18 @@ Job::exec() py::scoped_interpreter guard {}; // Import, but do not keep the handle lying around + try { auto calamaresModule = py::module_::import( "libcalamares" ); calamaresModule.attr( "job" ) = Calamares::Python::JobProxy( this ); calamaresModule.attr( "globalstorage" ) = Calamares::Python::GlobalStorageProxy( JobQueue::instance()->globalStorage() ); } + catch ( const py::error_already_set& e ) + { + cError() << "Error in import:" << e.what(); + throw; // This is non-recoverable + } if ( s_preScript ) {