Commit 4dd25f0b authored by Ignacio Casal Quinteiro's avatar Ignacio Casal Quinteiro Committed by Juan Pablo Ugarte
Browse files

Bump pygobject requisite to pygobject 3. Fixes bug #658667.

parent e28dd850
2011-09-19 Ignacio Casal Quinteiro <icq@gnome.org>
* configure.ac, plugins/python/glade-python.c:
Bump pygobject requisite to pygobject 3. Fixes bug #658667.
2011-06-14 Juan Pablo Ugarte <juanpablougarte@gmail.com>
* gladeui/glade-project.h:
......
......@@ -144,10 +144,10 @@ AM_CONDITIONAL(HAVE_GTK_UNIX_PRINT, test x"$have_unix_print" = "xyes")
dnl ================================================================
dnl Python for optional python dev libs
dnl ================================================================
PYGOBJECT_REQS=2.27.0
PYGOBJECT_REQS=2.90.4
PYGOBJECT_REQUIRED_MAJOR=2
PYGOBJECT_REQUIRED_MINOR=27
PYGOBJECT_REQUIRED_MICRO=0
PYGOBJECT_REQUIRED_MINOR=90
PYGOBJECT_REQUIRED_MICRO=4
AC_ARG_ENABLE(python,
AS_HELP_STRING([--disable-python], [disable python catalog]),
......@@ -156,7 +156,7 @@ AC_ARG_ENABLE(python,
if test x"$check_python" = x"yes"; then
have_python=yes
PKG_CHECK_MODULES([PYGOBJECT],[pygobject-2.0 >= ${PYGOBJECT_REQUIRED_MAJOR}.${PYGOBJECT_REQUIRED_MINOR}.${PYGOBJECT_REQUIRED_MICRO}],[have_pygobject=yes],[have_pygobject=no])
PKG_CHECK_MODULES([PYGOBJECT],[pygobject-3.0 >= ${PYGOBJECT_REQUIRED_MAJOR}.${PYGOBJECT_REQUIRED_MINOR}.${PYGOBJECT_REQUIRED_MICRO}],[have_pygobject=yes],[have_pygobject=no])
AM_CHECK_PYTHON_HEADERS(, [have_python_headers=no])
AM_CHECK_PYTHON_LIBS(, [have_python_lib=no])
......
......@@ -44,29 +44,33 @@ python_init (void)
static void
glade_python_init_pygobject_check (gint req_major, gint req_minor, gint req_micro)
{
PyObject *gobject, *mdict, *version;
int found_major, found_minor, found_micro;
PyObject *gi, *gobject;
init_pygobject ();
/* import gobject */
pygobject_init (req_major, req_minor, req_micro);
if (PyErr_Occurred ())
{
g_warning ("Error initializing Python interpreter: could not "
"import pygobject");
return;
}
gobject = PyImport_ImportModule ("gobject");
mdict = PyModule_GetDict (gobject);
version = PyDict_GetItemString (mdict, "pygobject_version");
if (!version)
gi = PyImport_ImportModule ("gi");
if (gi == NULL)
{
PyErr_SetString (PyExc_ImportError, "PyGObject version too old");
g_warning ("Error initializing Python interpreter: could not "
"import gi");
return;
}
if (!PyArg_ParseTuple
(version, "iii", &found_major, &found_minor, &found_micro))
return;
if (req_major != found_major || req_minor > found_minor ||
(req_minor == found_minor && req_micro > found_micro))
gobject = PyImport_ImportModule ("gi.repository.GObject");
if (gobject == NULL)
{
PyErr_Format (PyExc_ImportError,
"PyGObject version mismatch, %d.%d.%d is required, "
"found %d.%d.%d.", req_major, req_minor, req_micro,
found_major, found_minor, found_micro);
g_warning ("Error initializing Python interpreter: could not "
"import gobject");
return;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment