diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-16 18:16:55 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-16 18:16:55 +0000 |
| commit | 93ea4c4d2ea2b1ff3dfee40fb114f3080001e4ce (patch) | |
| tree | 54ea05bc7ac6a01a92695370933ab8805c2a0fdc /src/python.cc | |
| parent | 16a952c35dd15d52b304abaf9c366e9263b45430 (diff) | |
supply more information about errors when running scripts
Diffstat (limited to 'src/python.cc')
| -rw-r--r-- | src/python.cc | 6 |
1 files changed, 3 insertions, 3 deletions
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<char*>(path.c_str())); @@ -51,7 +51,7 @@ bool python_exec(const std::string &path) assert(dict); PyObject *result = PyRun_File(rcpyfd, const_cast<char*>(path.c_str()), Py_file_input, dict, dict); - bool ret = result != NULL; + int ret = result == NULL ? 2 : 0; if (result == NULL) PyErr_Print(); |
