bt2: use format_bt_error and format_bt_error_cause to generate _Error and _ErrorCause...
[babeltrace.git] / src / bindings / python / bt2 / bt2 / native_bt_trace_class.i.h
index 5e91a6c21553f067473a5fc4ce98dc94ce60c2d8..48a1734ac17a178a6486dca7e5801ef751c7ea36 100644 (file)
@@ -32,17 +32,18 @@ trace_class_destroyed_listener(const bt_trace_class *trace_class, void *py_calla
                SWIGTYPE_p_bt_trace_class, 0);
        if (!py_trace_class_ptr) {
                BT_LOGF_STR("Failed to create a SWIG pointer object.");
-               abort();
+               bt_common_abort();
        }
 
        py_res = PyObject_CallFunction(py_callable, "(O)", py_trace_class_ptr);
-       if (py_res) {
-               BT_ASSERT(py_res == Py_None);
-       } else {
-               loge_exception("Trace class's destruction listener (Python)",
-                       BT_LOG_OUTPUT_LEVEL);
+       if (!py_res) {
+               logw_exception_clear(BT_LOG_OUTPUT_LEVEL);
+               goto end;
        }
 
+       BT_ASSERT(py_res == Py_None);
+
+end:
        Py_DECREF(py_trace_class_ptr);
        Py_XDECREF(py_res);
 }
@@ -56,6 +57,7 @@ int bt_bt2_trace_class_add_destruction_listener(
 
        BT_ASSERT(trace_class);
        BT_ASSERT(py_callable);
+
        status = bt_trace_class_add_destruction_listener(
                trace_class, trace_class_destroyed_listener, py_callable, id);
        if (status == __BT_FUNC_STATUS_OK) {
This page took 0.024886 seconds and 4 git commands to generate.