1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-21 10:26:38 +02:00

Fix display of python errors

This commit is contained in:
Sebastien Helleu
2009-03-28 22:06:10 +01:00
parent b2f1273c01
commit 85495d4b95
+6 -4
View File
@@ -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;