diff options
author | Thomas Haller <thaller@redhat.com> | 2015-11-11 10:37:07 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-11-11 10:56:05 +0100 |
commit | 8d1233e67e0db2c53717d9bd1bf9935958ffd79a (patch) | |
tree | 3a70833fe267d67e5c06bc3575fd10a99d570cce /libnm/generate-setting-docs.py | |
parent | 0dc48370b48c08300713df611b7c9d3937306be3 (diff) | |
download | NetworkManager-8d1233e67e0db2c53717d9bd1bf9935958ffd79a.tar.gz |
python: use gi.require_version() in generate-setting-docs.py and examples
gi now emits a warning when not loading a specific library
version [1]:
./generate-setting-docs.py:21: 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.
from gi.repository import NM, GObject
Seems require_version() is reasonably old to just always use it without
breaking on older versions [2].
[1] Related: https://bugzilla.gnome.org/show_bug.cgi?id=727379
[2] https://git.gnome.org/browse/pygobject/commit/?id=76758efb6579752237a0dc4d56cf9518de6c6e55
Diffstat (limited to 'libnm/generate-setting-docs.py')
-rwxr-xr-x | libnm/generate-setting-docs.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libnm/generate-setting-docs.py b/libnm/generate-setting-docs.py index e1e35a86d9..8265bccd10 100755 --- a/libnm/generate-setting-docs.py +++ b/libnm/generate-setting-docs.py @@ -18,6 +18,8 @@ from __future__ import print_function +import gi +gi.require_version('NM', '1.0') from gi.repository import NM, GObject import argparse, datetime, re, sys import xml.etree.ElementTree as ET |