]> sigrok.org Git - libsigrokdecode.git/blobdiff - exception.c
srd: onewire_link/network: Fix annotations, small cleanups.
[libsigrokdecode.git] / exception.c
index aa7ab616d58df4a949e8cf0c814ca06118c9a73a..0c248e169e4c4b45502a8d781df86b532e47801c 100644 (file)
@@ -24,8 +24,7 @@
 #include <glib.h>
 #include <frameobject.h> /* Python header not pulled in by default. */
 
-
-void catch_exception(const char *format, ...)
+SRD_PRIV void srd_exception_catch(const char *format, ...)
 {
        PyObject *etype, *evalue, *etb, *py_str;
        PyTracebackObject *py_tb;
@@ -68,10 +67,11 @@ void catch_exception(const char *format, ...)
        /* Send a more precise error location to srd_dbg(), if we have it. */
        if (etb && etb != Py_None) {
                tracestr = NULL;
-               py_tb = (PyTracebackObject *) etb;
+               py_tb = (PyTracebackObject *)etb;
                py_str = PyUnicode_FromFormat("%U:%d in %U",
-                               py_tb->tb_frame->f_code->co_filename, py_tb->tb_frame->f_lineno,
-                               py_tb->tb_frame->f_code->co_name);
+                                       py_tb->tb_frame->f_code->co_filename,
+                                       py_tb->tb_frame->f_lineno,
+                                       py_tb->tb_frame->f_code->co_name);
                py_str_as_str(py_str, &tracestr);
                Py_DecRef(py_str);
                g_string_printf(msg, "%s in %s: %s", ename, tracestr, str);
@@ -87,8 +87,4 @@ void catch_exception(const char *format, ...)
 
        /* Just in case. */
        PyErr_Clear();
-
-       return;
 }
-
-