X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fpython.cc;h=0741f2da940e4df8f40e4cb8ef91ab9e8ab84844;hb=fbfa2798623ffa2ae34946070d35eb529a6cb6a9;hp=eb08775e08d7a5356288ee8e56f521a3c9cdda46;hpb=c8789ccdbf40c8f0730cbe4c68b8f43b2d9a7f85;p=chaz%2Fopenbox diff --git a/src/python.cc b/src/python.cc index eb08775e..0741f2da 100644 --- a/src/python.cc +++ b/src/python.cc @@ -35,12 +35,12 @@ void python_destroy() Py_Finalize(); } -bool python_exec(const std::string &path) +int python_exec(const std::string &path) { FILE *rcpyfd = fopen(path.c_str(), "r"); if (!rcpyfd) { fprintf(stderr, _("Unabled to open python file %s\n"), path.c_str()); - return false; + return 1; } //PyRun_SimpleFile(rcpyfd, const_cast(path.c_str())); @@ -51,7 +51,7 @@ bool python_exec(const std::string &path) assert(dict); PyObject *result = PyRun_File(rcpyfd, const_cast(path.c_str()), Py_file_input, dict, dict); - bool ret = result != NULL; + int ret = result == NULL ? 2 : 0; if (result == NULL) PyErr_Print();