- Readd my patch to not blow up mysteriously Resolves: #596392

This commit is contained in:
Colin Walters 2010-05-27 14:36:37 +00:00
parent 489d8c7a93
commit 856273f813
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From 8a577bcbbeca38f94363e8313410b8a5499de975 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
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
https://bugzilla.gnome.org/show_bug.cgi?id=617796
---
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

View File

@ -15,7 +15,7 @@
Name: pygobject2
Version: 2.21.1
Release: 8%{?dist}
Release: 9%{?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
# https://bugzilla.gnome.org/show_bug.cgi?id=617796
Patch2: Clear-error-if-we-failed-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,6 +128,10 @@ rm -fr $RPM_BUILD_ROOT
%{_datadir}/pygobject/xsl
%changelog
* Thu May 27 2010 Colin Walters <walters@verbum.org> - 2.21.1-9
- Readd my patch to not blow up mysteriously
Resolves: #596392
* Mon May 24 2010 Colin Walters <walters@verbum.org> - 2.21.1-7
- Reenable pygi in preparation for getting it packaged