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.
This commit is contained in:
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
# This example lists all devices, both real and placeholder ones
|
# This example lists all devices, both real and placeholder ones
|
||||||
|
|
||||||
|
import gi
|
||||||
|
gi.require_version('NM', '1.0')
|
||||||
from gi.repository import GLib, NM
|
from gi.repository import GLib, NM
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Reference in New Issue
Block a user