diff --git a/pygi-Clear-error-if-we-failed-the-import.patch b/pygi-Clear-error-if-we-failed-the-import.patch new file mode 100644 index 0000000..da8c714 --- /dev/null +++ b/pygi-Clear-error-if-we-failed-the-import.patch @@ -0,0 +1,34 @@ +From 83a2aeb2670ede54127385057b0f9c722f07180f Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Wed, 5 May 2010 13:54:27 -0400 +Subject: [PATCH] [pygi] 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 +--- + 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; + } +-- +1.7.0.1 + diff --git a/pygobject2.spec b/pygobject2.spec index 8e43b8a..19426c2 100644 --- a/pygobject2.spec +++ b/pygobject2.spec @@ -15,7 +15,7 @@ Name: pygobject2 Version: 2.21.1 -Release: 4%{?dist} +Release: 5%{?dist} License: LGPLv2+ Group: Development/Languages Summary: Python bindings for GObject @@ -23,6 +23,8 @@ URL: http://www.pygtk.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-root #VCS: git:git://git.gnome.org/pygobject Patch1: Don-t-raise-an-error-in-_pygi_import-if-pygi-support-is-disabled.patch +# Local patch; will send upstream soon +Patch2: pygi-Clear-error-if-we-failed-the-import.patch Source: http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.21/pygobject-%{version}.tar.bz2 ### Build Dependencies ### @@ -71,6 +73,7 @@ This package contains documentation files for %{name}. %prep %setup -q -n pygobject-%{version} %patch1 -p1 +%patch2 -p1 %build %configure --enable-thread --enable-pygi @@ -125,7 +128,11 @@ rm -fr $RPM_BUILD_ROOT %{_datadir}/pygobject/xsl %changelog -* Fri May 26 2010 Colin Walters - 2.21.1-4 +* Wed May 05 2010 Colin Walters - 2.21.1-5 +- Another patch to clear error when we've enabled pygi + Should really fix bug #569885 + +* Fri Mar 26 2010 Colin Walters - 2.21.1-4 - Cherrypick patch from HEAD to fix pygi imports Hopefully fixes bug #569885