Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a Python application that ran without problem on 12.10, but on upgrading to 13.04 the application fails with the following error :

except gi._glib.GError, e:

AttributeError: 'module' object has no attribute 'GError'

Is there a change in the Python 2 Gtk libraries associated with 13.04 ?

share|improve this question
    
Did you write the application? If not, where does it come from? –  Jennifer Wilson Apr 27 '13 at 9:40
add comment

1 Answer 1

Functions, methods, attributes, etc with an underscore are used as internal methods in Python. These can change or deleted without warning, so it's better to never use these outside that package.

Try the following:

>>> from gi.repository import GObject, GLib
>>> GObject.GError
<class 'gi._glib.GError'>
>>> GLib.GError
<class 'gi._glib.GError'>

This also works on Ubuntu 12.10 and possibly earlier.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.