diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-03-28 22:06:10 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-03-28 22:06:10 +0100 |
commit | 85495d4b9582de474209f739928323b12bb5ffe7 (patch) | |
tree | ea4c42660a2291f6ae7015dc04c334212d802922 /src/plugins/scripts/python | |
parent | b2f1273c01f2f13f02683a7d31823540f251f951 (diff) | |
download | weechat-85495d4b9582de474209f739928323b12bb5ffe7.zip |
Fix display of python errors
Diffstat (limited to 'src/plugins/scripts/python')
-rw-r--r-- | src/plugins/scripts/python/weechat-python.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/scripts/python/weechat-python.c b/src/plugins/scripts/python/weechat-python.c index 8fcb5b465..43347218a 100644 --- a/src/plugins/scripts/python/weechat-python.c +++ b/src/plugins/scripts/python/weechat-python.c @@ -152,7 +152,12 @@ weechat_python_exec (struct t_plugin_script *script, if (rc == NULL) rc = PyInt_FromLong (0); - if (PyString_Check (rc) && (ret_type == WEECHAT_SCRIPT_EXEC_STRING)) + if (PyErr_Occurred()) + { + PyErr_Print (); + Py_XDECREF(rc); + } + else if (PyString_Check (rc) && (ret_type == WEECHAT_SCRIPT_EXEC_STRING)) { if (PyString_AsString (rc)) ret_value = strdup (PyString_AsString(rc)); @@ -191,9 +196,6 @@ weechat_python_exec (struct t_plugin_script *script, return NULL; } - if (PyErr_Occurred ()) - PyErr_Print (); - /* PyEval_ReleaseThread (python_current_script->interpreter); */ return ret_value; |