[totem/gnome-2-30] Fix version requirements for PyGTK



commit aeeb165117a80080b044d54d5dc8b64df3128c26
Author: Jonathan Matthew <jonathan kaolin wh9 net>
Date:   Fri May 7 13:23:17 2010 +0100

    Fix version requirements for PyGTK
    
    pygtk.require() actually needs the major GTK+ version, and
    doesn't use the minor version in the require.
    
    Also make sure to check for the return value to avoid surprises.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=617821

 src/plugins/totem-python-module.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/totem-python-module.c b/src/plugins/totem-python-module.c
index 5db787d..7eee97c 100644
--- a/src/plugins/totem-python-module.c
+++ b/src/plugins/totem-python-module.c
@@ -151,7 +151,7 @@ totem_python_module_init_python (void)
 
 	PySys_SetArgv (1, argv);
 
-	/* pygtk.require("2.8") */
+	/* pygtk.require("2.0") */
 	pygtk = PyImport_ImportModule ("pygtk");
 	if (pygtk == NULL) {
 		g_warning ("Could not import pygtk, check your installation");
@@ -161,7 +161,12 @@ totem_python_module_init_python (void)
 
 	mdict = PyModule_GetDict (pygtk);
 	require = PyDict_GetItemString (mdict, "require");
-	PyObject_CallObject (require, Py_BuildValue ("(S)", PyString_FromString ("2.8")));
+	PyObject_CallObject (require, Py_BuildValue ("(S)", PyString_FromString ("2.0")));
+	if (PyErr_Occurred ()) {
+		g_warning ("Could not get required pygtk version, check your installation");
+		PyErr_Print();
+		return;
+	}
 
 	/* import gobject */
 	init_pygobject ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]