summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-09-24 19:42:24 +0200
committerThomas Haller <thaller@redhat.com>2019-09-25 15:47:39 +0200
commitceae05cc4b1eea38916c4fc23e8ce809de7d0ebd (patch)
treea25659a618a1b47e07779d218b701cc6adcdc2ef
parent85bdf421129262357484d681be3af21ebc72c15d (diff)
downloadNetworkManager-ceae05cc4b1eea38916c4fc23e8ce809de7d0ebd.tar.gz
tests: avoid deprecated GLib.IOChannel.add_watch() in "test-networkmanager-service.py"
test_001 (__main__.TestNmcli) ... /tmp/NetworkManager/tools/test-networkmanager-service.py:2346: PyGIDeprecationWarning: add_watch is deprecated; use GLib.io_add_watch() instead id1 = GLib.IOChannel(0).add_watch(GLib.IOCondition.HUP,
-rwxr-xr-xtools/test-networkmanager-service.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py
index c921aedefa..fbf95b0355 100755
--- a/tools/test-networkmanager-service.py
+++ b/tools/test-networkmanager-service.py
@@ -2343,8 +2343,10 @@ def main():
raise AssertionError("Failure to request D-Bus name org.freedesktop.NetworkManager")
# Watch stdin; if it closes, assume our parent has crashed, and exit
- id1 = GLib.IOChannel(0).add_watch(GLib.IOCondition.HUP,
- lambda io, condition: gl.mainloop.quit() or True)
+ id1 = GLib.io_add_watch(GLib.IOChannel.unix_new(0),
+ GLib.PRIORITY_DEFAULT,
+ GLib.IO_HUP,
+ lambda io, condition: gl.mainloop.quit() or True)
gl.mainloop.run()