[pygobject] testhelper: propagate exception if _gobject could not be imported



commit 3fe9213a3886ffa7a380dc08c5d636cda5865462
Author: Mikhail Fludkov <misha pexip com>
Date:   Fri Feb 19 16:27:53 2016 +0100

    testhelper: propagate exception if _gobject could not be imported
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772949

 tests/testhelpermodule.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/tests/testhelpermodule.c b/tests/testhelpermodule.c
index 66c0155..fc62b29 100644
--- a/tests/testhelpermodule.c
+++ b/tests/testhelpermodule.c
@@ -612,9 +612,13 @@ static PyMethodDef testhelper_functions[] = {
 
 PYGLIB_MODULE_START(testhelper, "testhelper")
 {
+  PyObject *gobject_module;
   PyObject *m, *d;
-  
-  pygobject_init(-1, -1, -1);
+
+
+  if ((gobject_module = pygobject_init(-1, -1, -1)) == NULL)
+    return NULL;
+  Py_DECREF (gobject_module);
 
   d = PyModule_GetDict(module);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]