summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 61de587)
raw | patch | inline | side by side (parent: 61de587)
author | Sven Trenkel <collectd@semidefinite.de> | |
Thu, 3 Dec 2009 01:19:59 +0000 (02:19 +0100) | ||
committer | Sven Trenkel <collectd@semidefinite.de> | |
Thu, 3 Dec 2009 01:19:59 +0000 (02:19 +0100) |
src/python.c | patch | blob | history |
diff --git a/src/python.c b/src/python.c
index 86bad3daf5ded1cd65173beeb216bc78ea7a6253..3b227c9bb0123e4b94ad1a954d02eaa549c7eafd 100644 (file)
--- a/src/python.c
+++ b/src/python.c
typename = "NamelessException";
if (message == NULL)
message = "N/A";
+ Py_BEGIN_ALLOW_THREADS
ERROR("Unhandled python exception in %s: %s: %s", context, typename, message);
+ Py_END_ALLOW_THREADS
Py_XDECREF(tn);
Py_XDECREF(m);
if (!cpy_format_exception) {
Py_DECREF(line);
if (s[strlen(s) - 1] == '\n')
s[strlen(s) - 1] = 0;
+ Py_BEGIN_ALLOW_THREADS
ERROR("%s", s);
+ Py_END_ALLOW_THREADS
free(s);
}
Py_XDECREF(list);
Py_DECREF(ret);
}
CPY_RELEASE_THREADS
+ if (ret == NULL)
+ return 1;
return 0;
}
@@ -346,7 +352,9 @@ static int cpy_write_callback(const data_set_t *ds, const value_list_t *value_li
else
PyList_SetItem(list, i, PyLong_FromUnsignedLongLong(value_list->values[i].absolute));
} else {
+ Py_BEGIN_ALLOW_THREADS
ERROR("cpy_write_callback: Unknown value type %d.", ds->ds->type);
+ Py_END_ALLOW_THREADS
Py_DECREF(list);
CPY_RETURN_FROM_THREADS 0;
}
#ifdef COLLECT_DEBUG
const char *text;
if (PyArg_ParseTuple(args, "s", &text) == 0) return NULL;
+ Py_BEGIN_ALLOW_THREADS
plugin_log(LOG_DEBUG, "%s", text);
+ Py_END_ALLOW_THREADS
#endif
Py_RETURN_NONE;
}