Hello community, here is the log from the commit of package python-gtk for openSUSE:Factory checked in at Fri Feb 11 02:10:59 CET 2011. -------- --- GNOME/python-gtk/python-gtk.changes 2010-09-26 06:25:04.000000000 +0200 +++ /mounts/work_src_done/STABLE/python-gtk/python-gtk.changes 2011-02-09 19:15:42.000000000 +0100 @@ -1,0 +2,7 @@ +Wed Feb 9 18:15:22 UTC 2011 - jmatejek@novell.com + +- added patch that switches to new Capsule API, because the deprecated + PyCObject API will cause a segfault when warnings are exceptions + (bnc#669802) + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- pygtk-2.22.0-capsule.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-gtk.spec ++++++ --- /var/tmp/diff_new_pack.kaFy0V/_old 2011-02-11 02:10:46.000000000 +0100 +++ /var/tmp/diff_new_pack.kaFy0V/_new 2011-02-11 02:10:46.000000000 +0100 @@ -1,7 +1,7 @@ # -# spec file for package python-gtk (Version 2.22.0) +# spec file for package python-gtk # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -31,11 +31,14 @@ Url: http://www.pygtk.org/ Summary: Python bindings for the GTK+ widget set Version: 2.22.0 -Release: 1 +Release: 2 License: LGPLv2.1+ Group: Development/Libraries/Python Source: %{_name}-%{version}.tar.bz2 +# conditionally use the new Capsule API instead of PyCObject, bnc#669802 +Patch0: pygtk-2.22.0-capsule.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build + %define lparen ( %define rparen ) %define python_gtk_req %(zgrep -a _required_version %{S:0} | sed -n 's/_required_version,[[:space:]]*/ >= /;s/%{rparen}$//;s/1.0.2%{rparen} dnl or 1.1.7/1.1.7/;s/\\%{lparen}glib\\|gtk\\|libglade\\|gobject\\%{rparen}/&2/;s/py\\%{lparen}.*\\%{rparen} /python-\\1 /;/gtk2unixprint/d;s/^m4_define%{lparen}//p' | tr '\\n' ' ') @@ -75,6 +78,7 @@ %prep %setup -q -n %{_name}-%{version} +%patch0 -p1 %build %configure ++++++ pygtk-2.22.0-capsule.patch ++++++ diff --git a/gtk/gtkmodule.c b/gtk/gtkmodule.c index c0e1493..aa8cf10 100644 --- a/gtk/gtkmodule.c +++ b/gtk/gtkmodule.c @@ -227,8 +227,12 @@ init_gtk(void) pygtk_add_stock_items(d); /* extension API */ - PyDict_SetItemString(d, "_PyGtk_API", - o=PyCObject_FromVoidPtr(&functions, NULL)); +#if PY_VERSION_HEX >= 0x02070000 + o = PyCapsule_New(&functions, "gtk._gtk._PyGtk_API", NULL); +#else + o = PyCObject_FromVoidPtr(&functions, NULL); +#endif + PyDict_SetItemString(d, "_PyGtk_API", o); Py_DECREF(o); PyGtkDeprecationWarning = PyErr_NewException("gtk.GtkDeprecationWarning", diff --git a/gtk/pygtk.h b/gtk/pygtk.h index 573c3b9..e4c680f 100644 --- a/gtk/pygtk.h +++ b/gtk/pygtk.h @@ -60,6 +60,18 @@ struct _PyGtk_FunctionStruct *_PyGtk_API; /* a function to initialise the pygtk functions */ + +/* Python 2.7 introduced the PyCapsule API and deprecated the CObject API */ +#if PY_VERSION_HEX >= 0x02070000 +#define init_pygtk() G_STMT_START { \ + void *capsule = PyCapsule_Import("gtk._gtk._PyGtk_API", 0); \ + if (!capsule) { \ + return; \ + } \ + _PyGtk_API = (struct _PyGtk_FunctionStruct*)capsule; \ +} G_STMT_END +#else /* PY_VERSION_HEX */ +/* Python 2.6 and earlier use the CObject API */ #define init_pygtk() G_STMT_START { \ PyObject *pygtk = PyImport_ImportModule("gtk"); \ if (pygtk != NULL) { \ @@ -79,6 +91,7 @@ struct _PyGtk_FunctionStruct *_PyGtk_API; return; \ } \ } G_STMT_END +#endif /* PY_VERSION_HEX */ #endif ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org