diff options
author | Thomas Haller <thaller@redhat.com> | 2016-11-16 11:50:28 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-11-16 11:50:30 +0100 |
commit | 2837da9b306f3630fbb7db327dc848fbd1b2e5aa (patch) | |
tree | fb330f9ea29b03865748c7399f0fde6bf56f11f0 /examples | |
parent | 167bddb33347be131faa8db49977fd8aec938c0d (diff) | |
download | NetworkManager-2837da9b306f3630fbb7db327dc848fbd1b2e5aa.tar.gz |
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-x | examples/python/gi/get-devices.py | 2 |
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__": |