diff options
author | Simon van der Linden <svdlinden@src.gnome.org> | 2010-01-21 17:30:51 +0100 |
---|---|---|
committer | Simon van der Linden <svdlinden@src.gnome.org> | 2010-02-02 22:10:22 +0100 |
commit | 23fc0f615d87994acafd9d39e92dd92b587fc2eb (patch) | |
tree | be5cf6c7221aab920d43c7547379593aa9df9033 | |
parent | 289d641775d1ea52d2a5379126b70b7fcee46683 (diff) | |
download | pygobject-23fc0f615d87994acafd9d39e92dd92b587fc2eb.tar.gz pygobject-23fc0f615d87994acafd9d39e92dd92b587fc2eb.tar.xz pygobject-23fc0f615d87994acafd9d39e92dd92b587fc2eb.zip |
Don't raise an error in _pygi_import if pygi support is disabled
http://bugzilla.gnome.org/show_bug.cgi?id=607674
-rw-r--r-- | gobject/pygboxed.c | 6 | ||||
-rw-r--r-- | gobject/pygi-external.h | 1 | ||||
-rw-r--r-- | gobject/pygobject.c | 6 | ||||
-rw-r--r-- | gobject/pygpointer.c | 6 |
4 files changed, 3 insertions, 16 deletions
diff --git a/gobject/pygboxed.c b/gobject/pygboxed.c index 1233b01..87695eb 100644 --- a/gobject/pygboxed.c +++ b/gobject/pygboxed.c @@ -185,12 +185,8 @@ pyg_boxed_new(GType boxed_type, gpointer boxed, gboolean copy_boxed, tp = g_type_get_qdata(boxed_type, pygboxed_type_key); - if (tp == NULL) { + if (!tp) tp = (PyTypeObject *)pygi_type_import_by_g_type(boxed_type); - if (tp == NULL) { - PyErr_Clear(); - } - } if (!tp) tp = (PyTypeObject *)&PyGBoxed_Type; /* fallback */ diff --git a/gobject/pygi-external.h b/gobject/pygi-external.h index e0d11c2..aec2f25 100644 --- a/gobject/pygi-external.h +++ b/gobject/pygi-external.h @@ -49,7 +49,6 @@ _pygi_import (void) return 0; #else - PyErr_SetString(PyExc_ImportError, "PyGI support not enabled"); return -1; #endif /* ENABLE_PYGI */ } diff --git a/gobject/pygobject.c b/gobject/pygobject.c index 222280b..f8d7dd1 100644 --- a/gobject/pygobject.c +++ b/gobject/pygobject.c @@ -874,12 +874,8 @@ pygobject_lookup_class(GType gtype) if (py_type == NULL) { py_type = g_type_get_qdata(gtype, pyginterface_type_key); - if (py_type == NULL) { + if (py_type == NULL) py_type = (PyTypeObject *)pygi_type_import_by_g_type(gtype); - if (py_type == NULL) { - PyErr_Clear(); - } - } if (py_type == NULL) { py_type = pygobject_new_with_interfaces(gtype); diff --git a/gobject/pygpointer.c b/gobject/pygpointer.c index 449b80c..5f6417f 100644 --- a/gobject/pygpointer.c +++ b/gobject/pygpointer.c @@ -159,12 +159,8 @@ pyg_pointer_new(GType pointer_type, gpointer pointer) tp = g_type_get_qdata(pointer_type, pygpointer_class_key); - if (tp == NULL) { + if (!tp) tp = (PyTypeObject *)pygi_type_import_by_g_type(pointer_type); - if (tp == NULL) { - PyErr_Clear(); - } - } if (!tp) tp = (PyTypeObject *)&PyGPointer_Type; /* fallback */ |