summaryrefslogtreecommitdiff
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
commit2837da9b306f3630fbb7db327dc848fbd1b2e5aa (patch)
treefb330f9ea29b03865748c7399f0fde6bf56f11f0
parent167bddb33347be131faa8db49977fd8aec938c0d (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.
-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 5a387bd2d5..4f06c870ae 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__":