From 2837da9b306f3630fbb7db327dc848fbd1b2e5aa Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 16 Nov 2016 11:50:28 +0100 Subject: [PATCH] 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. --- examples/python/gi/get-devices.py | 2 ++ 1 file changed, 2 insertions(+) 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__":