summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Matthew <jonathan@kaolin.wh9.net>2010-05-07 13:23:17 +0100
committerBastien Nocera <hadess@hadess.net>2010-05-07 13:25:56 +0100
commitaeeb165117a80080b044d54d5dc8b64df3128c26 (patch)
tree68de60e6a888ae949a2312f0d5c34cba31967a2c
parentf6fa6e869330bb2e64b67f966f6873412c3ca081 (diff)
downloadtotem-aeeb165117a80080b044d54d5dc8b64df3128c26.tar.gz
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
-rw-r--r--src/plugins/totem-python-module.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/totem-python-module.c b/src/plugins/totem-python-module.c
index 5db787d94..7eee97cde 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 ();