mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
gst-python: Print exception if pygobject fails to initialize
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6159>
This commit is contained in:
parent
768aeb739a
commit
b5b7064419
1 changed files with 14 additions and 1 deletions
|
@ -294,7 +294,20 @@ plugin_init (GstPlugin * plugin)
|
|||
|
||||
GST_LOG ("initializing pygobject");
|
||||
if (!pygobject_init (3, 0, 0)) {
|
||||
g_critical ("pygobject initialization failed");
|
||||
if (PyErr_Occurred ()) {
|
||||
PyObject *type, *value, *traceback;
|
||||
PyErr_Fetch (&type, &value, &traceback);
|
||||
PyObject *str = PyObject_Str (value);
|
||||
if (str) {
|
||||
g_critical ("pygobject initialization failed: %s\n",
|
||||
PyUnicode_AsUTF8 (str));
|
||||
Py_DECREF (str);
|
||||
}
|
||||
Py_XDECREF (type);
|
||||
Py_XDECREF (value);
|
||||
Py_XDECREF (traceback);
|
||||
PyErr_Clear ();
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue