From 6f9ecc1cd9cc1498ffac79e1271b831a9be6b364 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Wed, 6 Aug 2008 08:18:56 +0000 Subject: return in case of error instead of trying to access the internal types. 2008-08-06 Johan Dahlin * glib/pyglib.c (pyglib_init): return in case of error instead of trying to access the internal types. svn path=/trunk/; revision=926 --- glib/pyglib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'glib/pyglib.c') 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"); -- cgit