mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 16:50:16 +01:00
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:
parent
167bddb333
commit
2837da9b30
1 changed files with 2 additions and 0 deletions
|
|
@ -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__":
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue