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

Re: [virt-tools-list] [osinfo PATCH] Remove unused python gobject import



On Wed, Nov 30, 2011 at 03:02:34PM +0100, Christophe Fergeau wrote:
> Nothing in examples/demo.py uses this import, and having it causes a
> runtime error:
> 
> 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 |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/examples/demo.py b/examples/demo.py
> index ac09ae7..1aceef3 100755
> --- a/examples/demo.py
> +++ b/examples/demo.py
> @@ -1,6 +1,5 @@
>  #!/usr/bin/python
>  
> -import gobject
>  from gi.repository import Libosinfo as osinfo;
>  
>  loader = osinfo.Loader()

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


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