X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=exception.c;h=1ce66a875db44b23f4024545defe5bf8f08ac054;hp=aa7ab616d58df4a949e8cf0c814ca06118c9a73a;hb=3abc83b996547a69bad906ec748f30874aae4796;hpb=7a1712c4fd07f64222079acd5ec3fa3348a5cb15 diff --git a/exception.c b/exception.c index aa7ab61..1ce66a8 100644 --- a/exception.c +++ b/exception.c @@ -1,5 +1,5 @@ /* - * This file is part of the sigrok project. + * This file is part of the libsigrokdecode project. * * Copyright (C) 2012 Bert Vermeulen * @@ -17,15 +17,15 @@ * along with this program. If not, see . */ -#include "sigrokdecode.h" /* First, so we avoid a _POSIX_C_SOURCE warning. */ -#include "sigrokdecode-internal.h" +#include "libsigrokdecode.h" /* First, so we avoid a _POSIX_C_SOURCE warning. */ +#include "libsigrokdecode-internal.h" #include "config.h" #include #include #include /* Python header not pulled in by default. */ - -void catch_exception(const char *format, ...) +/** @private */ +SRD_PRIV void srd_exception_catch(const char *format, ...) { PyObject *etype, *evalue, *etb, *py_str; PyTracebackObject *py_tb; @@ -68,10 +68,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 +88,4 @@ void catch_exception(const char *format, ...) /* Just in case. */ PyErr_Clear(); - - return; } - -