aboutsummaryrefslogtreecommitdiffstats
path: root/common/pybindings.cc
diff options
context:
space:
mode:
Diffstat (limited to 'common/pybindings.cc')
-rw-r--r--common/pybindings.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/pybindings.cc b/common/pybindings.cc
index 5c86720e..454a571c 100644
--- a/common/pybindings.cc
+++ b/common/pybindings.cc
@@ -113,6 +113,7 @@ static wchar_t *program;
void init_python(const char *executable)
{
+#ifndef PYTHON_MODULE
program = Py_DecodeLocale(executable, NULL);
if (program == NULL) {
fprintf(stderr, "Fatal error: cannot decode executable filename\n");
@@ -129,12 +130,15 @@ void init_python(const char *executable)
std::string perror_str = parse_python_exception();
std::cout << "Error in Python: " << perror_str << std::endl;
}
+#endif
}
void deinit_python()
{
+#ifndef PYTHON_MODULE
Py_Finalize();
PyMem_RawFree(program);
+#endif
}
void execute_python_file(const char *python_file)