diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | glib/pyglib.c | 5 |
2 files changed, 10 insertions, 1 deletions
@@ -1,3 +1,9 @@ +2008-08-06 Johan Dahlin <johan@gnome.org> + + * glib/pyglib.c (pyglib_init): + return in case of error instead of trying to access the internal + types. + 2008-08-06 Paul Pogonyshev <pogonyshev@gmx.net> * gio/gio.override: Add 'pygio_do_icon_richcompare' prototype to diff --git a/glib/pyglib.c b/glib/pyglib.c index 3dd05a4..de8cbf9 100644 --- a/glib/pyglib.c +++ b/glib/pyglib.c @@ -63,9 +63,11 @@ pyglib_init(void) "could not import glib (error was: %s)", _PyUnicode_AsString(py_orig_exc)); Py_DECREF(py_orig_exc); - } else + } else { PyErr_SetString(PyExc_ImportError, "could not import glib (no error given)"); + } + return; } cobject = PyObject_GetAttrString(glib, "_PyGLib_API"); @@ -75,6 +77,7 @@ pyglib_init(void) PyErr_SetString(PyExc_ImportError, "could not import glib (could not find _PyGLib_API object)"); Py_DECREF(glib); + return; } _PyGMainContext_Type = (PyTypeObject*)PyObject_GetAttrString(glib, "MainContext"); |