diff --git a/bindings/pyroot/pythonizations/python/ROOT/_facade.py b/bindings/pyroot/pythonizations/python/ROOT/_facade.py index b745e08b49f06..5b1f064e56b7c 100644 --- a/bindings/pyroot/pythonizations/python/ROOT/_facade.py +++ b/bindings/pyroot/pythonizations/python/ROOT/_facade.py @@ -162,6 +162,9 @@ def _finalSetup(self): from ._application import PyROOTApplication from ._pythonization import _register_pythonizations, pythonization + # signal policy: don't abort interpreter in interactive mode + cppyy._backend.SetGlobalSignalPolicy(not cppyy.gbl.ROOT.GetROOT().IsBatch()) + self.__dict__["_cppyy"] = cppyy # Expose some functionality from CPyCppyy extension module diff --git a/bindings/pyroot/pythonizations/src/PyROOTModule.cxx b/bindings/pyroot/pythonizations/src/PyROOTModule.cxx index dfb400658e628..dff7f6f09ad5f 100644 --- a/bindings/pyroot/pythonizations/src/PyROOTModule.cxx +++ b/bindings/pyroot/pythonizations/src/PyROOTModule.cxx @@ -172,8 +172,6 @@ struct module_state { PyObject *error; }; -using namespace CPyCppyy; - #define GETSTATE(m) ((struct module_state *)PyModule_GetState(m)) static int rootmodule_traverse(PyObject *m, visitproc visit, void *arg) @@ -206,12 +204,5 @@ extern "C" PyObject *PyInit_libROOTPythonizations() // keep gRootModule, but do not increase its reference count even as it is borrowed, // or a self-referencing cycle would be created - // Make sure the interpreter is initialized once gROOT has been initialized - TInterpreter::Instance(); - - // signal policy: don't abort interpreter in interactive mode - CallContext::SetGlobalPolicy(CallContext::kProtected, !gROOT->IsBatch()); - - Py_INCREF(gRootModule); return gRootModule; }