[pygobject] testhelpermodule: Fix build warning for PyGObject_Type redefinition



commit 38683f721c33cc35f0260868e58643fd35f04cbe
Author: Simon Feltman <sfeltman src gnome org>
Date:   Sun Mar 17 02:08:03 2013 -0700

    testhelpermodule: Fix build warning for PyGObject_Type redefinition
    
    Remove dynamic retrieval of PyGObject_Type as it is available
    in pygobject.h since commit 2656bc47 (causing this compile warning)

 tests/testhelpermodule.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)
---
diff --git a/tests/testhelpermodule.c b/tests/testhelpermodule.c
index 9ca82bc..516cb97 100644
--- a/tests/testhelpermodule.c
+++ b/tests/testhelpermodule.c
@@ -7,9 +7,6 @@
 
 #include <pyglib-python-compat.h>
 
-static PyTypeObject *_PyGObject_Type;
-#define PyGObject_Type (*_PyGObject_Type)
-
 static PyObject * _wrap_TestInterface__do_iface_method(PyObject *cls,
                                                       PyObject *args,
                                                       PyObject *kwargs);
@@ -618,16 +615,7 @@ PYGLIB_MODULE_START(testhelper, "testhelper")
 
   d = PyModule_GetDict(module);
 
-  if ((m = PyImport_ImportModule("gi._gobject._gobject")) != NULL) {
-    PyObject *moddict = PyModule_GetDict(m);
-    
-    _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject");
-    if (_PyGObject_Type == NULL) {
-      PyErr_SetString(PyExc_ImportError,
-                     "cannot import name GObject from gobject");
-      return PYGLIB_MODULE_ERROR_RETURN;
-    }
-  } else {
+  if ((m = PyImport_ImportModule("gi._gobject._gobject")) == NULL) {
     PyErr_SetString(PyExc_ImportError,
                    "could not import gobject");
     return PYGLIB_MODULE_ERROR_RETURN;


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