* also do prevent python from registering its own signal handler, it does
not make sense in our embedded use case.
* pass python interpreter's path to embedded python before initializing
it. python uses this path to look up the "site" modules, etc.
so it can use other interpreter if it is not intalled into $PATH,
otherwise the "python" in $PATH will always be used even the
PYTHON_EXECUTABLE in CMake's cache is pointing to another python
interpreter.
if one want to debug ceph-mgr with a customize build python, this would
be helpful.
Signed-off-by: Kefu Chai <kchai@redhat.com>
/* Support POWER8 instructions */
#cmakedefine HAVE_POWER8
+#cmakedefine PYTHON_EXECUTABLE "@PYTHON_EXECUTABLE@"
+
#endif /* CONFIG_H */
global_handle = this;
// Set up global python interpreter
- Py_Initialize();
+ Py_SetProgramName(const_cast<char*>(PYTHON_EXECUTABLE));
+ Py_InitializeEx(0);
// Some python modules do not cope with an unpopulated argv, so lets
// fake one. This step also picks up site-packages into sys.path.