rpms/pygobject2/F-13 Don-t-raise-an-error-in-_pygi_import-if-pygi-support-is-disabled.patch, NONE, 1.1 pygobject2.spec, 1.62, 1.63

Colin Walters walters at fedoraproject.org
Fri Mar 26 13:33:26 UTC 2010


Author: walters

Update of /cvs/pkgs/rpms/pygobject2/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv22742

Modified Files:
	pygobject2.spec 
Added Files:
	Don-t-raise-an-error-in-_pygi_import-if-pygi-support-is-disabled.patch 
Log Message:
* Fri May 26 2010 Colin Walters <walters at verbum.org> - 2.21.1-4
- Cherrypick patch from HEAD to fix pygi imports
  Hopefully fixes bug #569885


Don-t-raise-an-error-in-_pygi_import-if-pygi-support-is-disabled.patch:
 pygboxed.c      |    6 +-----
 pygi-external.h |    1 -
 pygobject.c     |    6 +-----
 pygpointer.c    |    7 +------
 4 files changed, 3 insertions(+), 17 deletions(-)

--- NEW FILE Don-t-raise-an-error-in-_pygi_import-if-pygi-support-is-disabled.patch ---
>From 23fc0f615d87994acafd9d39e92dd92b587fc2eb Mon Sep 17 00:00:00 2001
From: Simon van der Linden <svdlinden at src.gnome.org>
Date: Thu, 21 Jan 2010 17:30:51 +0100
Subject: [PATCH] Don't raise an error in _pygi_import if pygi support is disabled

http://bugzilla.gnome.org/show_bug.cgi?id=607674
---
 gobject/pygboxed.c      |    6 +-----
 gobject/pygi-external.h |    1 -
 gobject/pygobject.c     |    6 +-----
 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 */
-- 
1.6.6.1



Index: pygobject2.spec
===================================================================
RCS file: /cvs/pkgs/rpms/pygobject2/F-13/pygobject2.spec,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -p -r1.62 -r1.63
--- pygobject2.spec	26 Jan 2010 23:48:29 -0000	1.62
+++ pygobject2.spec	26 Mar 2010 13:33:26 -0000	1.63
@@ -21,6 +21,8 @@ Group: Development/Languages
 Summary: Python bindings for GObject
 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
 Source: http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.21/pygobject-%{version}.tar.bz2
 
 ### Build Dependencies ###
@@ -68,6 +70,7 @@ This package contains documentation file
 
 %prep
 %setup -q -n pygobject-%{version}
+%patch1 -p1
 
 %build
 %configure --enable-thread --enable-pygi
@@ -122,6 +125,10 @@ rm -fr $RPM_BUILD_ROOT
 %{_datadir}/pygobject/xsl
 
 %changelog
+* Fri May 26 2010 Colin Walters <walters at verbum.org> - 2.21.1-4
+- Cherrypick patch from HEAD to fix pygi imports
+  Hopefully fixes bug #569885
+
 * Sat Jan 23 2010 Thomas Spura <tomspur at fedoraproject.org> - 2.21.1-3
 - add --enable-pygi (fixes bug #558003)
 - replace global with define



More information about the scm-commits mailing list