ATLAS Offline Software
Loading...
Searching...
No Matches
PyROOT Namespace Reference

Classes

class  CPPInstance

Functions

void throw_py_exception (bool display=true)

Function Documentation

◆ throw_py_exception()

void PyROOT::throw_py_exception ( bool display = true)
inline

Definition at line 29 of file AthenaPyRoot.h.

30{
31 if (display) {
32 // fetch error
33 PyObject* pytype = 0, *pyvalue = 0, *pytrace = 0;
34 PyErr_Fetch (&pytype, &pyvalue, &pytrace);
35 Py_XINCREF (pytype);
36 Py_XINCREF (pyvalue);
37 Py_XINCREF (pytrace);
38 // restore...
39 PyErr_Restore (pytype, pyvalue, pytrace);
40 // and print
41 PyErr_Print();
42 }
43#ifdef ATLAS_HAVE_CPYCPPYY
44 throw CPyCppyy::PyException();
45#else
46 throw std::runtime_error ("Python exception");
47#endif // ATLAS_HAVE_CPYCPPYY
48}
_object PyObject