diff options
author | piernov <piernov@piernov.org> | 2012-05-13 22:00:59 +0200 |
---|---|---|
committer | piernov <piernov@piernov.org> | 2012-05-13 22:00:59 +0200 |
commit | 3c08c3297a58a4e5c195c0b878aaa1cba4b3dd4f (patch) | |
tree | f102a90182af66c90aa6b00b38b0fdf5e089d257 /pygtk/python27.patch | |
parent | 0fed143fdb703cd0eff203a97ab7e40567a73e65 (diff) | |
download | nutyx-pakxe-3c08c3297a58a4e5c195c0b878aaa1cba4b3dd4f.tar.gz nutyx-pakxe-3c08c3297a58a4e5c195c0b878aaa1cba4b3dd4f.tar.bz2 nutyx-pakxe-3c08c3297a58a4e5c195c0b878aaa1cba4b3dd4f.tar.xz nutyx-pakxe-3c08c3297a58a4e5c195c0b878aaa1cba4b3dd4f.zip |
Revert "pygtk, ajout"
This reverts commit e62460bca68f5b2daa78eda4a31a2b8ece11a3ef.
Diffstat (limited to 'pygtk/python27.patch')
-rw-r--r-- | pygtk/python27.patch | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/pygtk/python27.patch b/pygtk/python27.patch deleted file mode 100644 index 9bbe2b5ae..000000000 --- a/pygtk/python27.patch +++ /dev/null @@ -1,50 +0,0 @@ -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 - |