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

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



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


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