diff options
| author | Colin Walters <walters@verbum.org> | 2010-05-05 17:54:27 (GMT) |
|---|---|---|
| committer | Tomeu Vizoso <tomeu.vizoso@collabora.co.uk> | 2010-06-08 08:24:09 (GMT) |
| commit | 46c91a11d448e5e11d142d3362aff1483226bca4 (patch) | |
| tree | 76a418c76573d82220f600f497af5646f8ac5a8f | |
| parent | e203dc7c8f524c16aa52e15758dc3a2b09fbac75 (diff) | |
| download | pygobject-46c91a11d448e5e11d142d3362aff1483226bca4.zip pygobject-46c91a11d448e5e11d142d3362aff1483226bca4.tar.xz | |
Clear error if we failed the import
Otherwise we leave the exception set which causes bizarre problems
later in unrelated code.
https://bugzilla.redhat.com/show_bug.cgi?id=569885
https://bugzilla.gnome.org/show_bug.cgi?id=617796
| -rw-r--r-- | gobject/pygi-external.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gobject/pygi-external.h b/gobject/pygi-external.h index aec2f25..b369dca 100644 --- a/gobject/pygi-external.h +++ b/gobject/pygi-external.h @@ -27,11 +27,13 @@ _pygi_import (void) module = PyImport_ImportModule("gi"); if (module == NULL) { + PyErr_Clear(); return -1; } api = PyObject_GetAttrString(module, "_API"); if (api == NULL) { + PyErr_Clear(); Py_DECREF(module); return -1; } |