[virt-tools-list] [osinfo PATCH] Use GObject from gi.repository in demo.py

Christophe Fergeau cfergeau at redhat.com
Wed Nov 30 10:10:40 UTC 2011


Otherwise it fails to run with:

Traceback (most recent call last):
  File "examples/demo.py", line 4, in <module>
    from gi.repository import Libosinfo as osinfo;
  File "/usr/lib64/python2.7/site-packages/gi/__init__.py", line 23, in <module>
    from ._gi import _API, Repository
ImportError: could not import gobject (error was: ImportError('When using
gi.repository you must not import static modules like "gobject". Please
change all occurrences of "import gobject" to "from gi.repository import
GObject".',))
---
 examples/demo.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/examples/demo.py b/examples/demo.py
index ac09ae7..8cab020 100755
--- a/examples/demo.py
+++ b/examples/demo.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-import gobject
+from gi.repository import GObject
 from gi.repository import Libosinfo as osinfo;
 
 loader = osinfo.Loader()
-- 
1.7.7.3




More information about the virt-tools-list mailing list