diff --git a/Applications/CLI/ogs_embedded_python.cpp b/Applications/CLI/ogs_embedded_python.cpp index 5c170cfe98a2596a178b76f9b0e990e0bb7a7b50..e41db52527d4bc0eed47d8e97f5732bbb85bc90a 100644 --- a/Applications/CLI/ogs_embedded_python.cpp +++ b/Applications/CLI/ogs_embedded_python.cpp @@ -50,7 +50,12 @@ pybind11::scoped_interpreter setupEmbeddedPython() mark_used(&pybind11_init_impl_OpenGeoSys); #endif - return pybind11::scoped_interpreter{}; + // Allows ogs to be interrupted by SIGINT, which otherwise is handled by + // python. See + // https://docs.python.org/3/c-api/exceptions.html#c.PyErr_CheckSignals and + // https://pybind11.readthedocs.io/en/stable/faq.html#how-can-i-properly-handle-ctrl-c-in-long-running-functions + constexpr bool init_signal_handlers = false; + return pybind11::scoped_interpreter{init_signal_handlers}; } } // namespace ApplicationsLib