summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-11-16 11:50:28 +0100
committerThomas Haller <thaller@redhat.com>2016-11-16 11:50:30 +0100
commit9139d1352f5ab2a24c032849df1e98b8c4c1cf1e (patch)
treefb330f9ea29b03865748c7399f0fde6bf56f11f0 /examples
parentc2485714917cdcfaf026f22f99cdd454bd7f43b6 (diff)
examples/python: fix "import gi" in example
Otherwise there is a warning: from gi.repository import GLib, NM __main__:1: PyGIWarning: NM was imported without specifying a version first. Use gi.require_version(NM, 1.0) before import to ensure that the right version gets loaded.
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/python/gi/get-devices.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/python/gi/get-devices.py b/examples/python/gi/get-devices.py
index 5a387bd2d..4f06c870a 100755
--- a/examples/python/gi/get-devices.py
+++ b/examples/python/gi/get-devices.py
@@ -21,6 +21,8 @@
# This example lists all devices, both real and placeholder ones
+import gi
+gi.require_version('NM', '1.0')
from gi.repository import GLib, NM
if __name__ == "__main__":