#include "pyFairModule.h"
#include "FairVolume.h"
#include "Python.h"
#include "TObject.h"
Go to the source code of this file.
◆ call_python_method()
| void call_python_method |
( |
PyObject * | self, |
|
|
const char * | method ) |
Definition at line 34 of file pyFairModule.cxx.
34 {
35
36 if (nullptr == self || nullptr == method) {
37 throw std::runtime_error("Invalid Python object and method");
38 }
39
40 PyObject* r = PyObject_CallMethod(self,
const_cast<char*
>(method),
41 const_cast<char*>(""));
42 if (nullptr == r) {
43 PyErr_Print();
44 return;
45 }
46
47 Py_XDECREF(r);
48
49 return;
50}