summaryrefslogtreecommitdiff
path: root/tools/test-networkmanager-service.py
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-05-15 11:38:05 +0200
committerThomas Haller <thaller@redhat.com>2018-05-15 11:44:47 +0200
commitc905ee94f09e76db917a684a2fb44d83886475f5 (patch)
tree65082a8c7eb26f7a15e307d117924ba669acaa76 /tools/test-networkmanager-service.py
parentd66b2774712523c3a6a687541881cf15432526c2 (diff)
downloadNetworkManager-c905ee94f09e76db917a684a2fb44d83886475f5.tar.gz
tests: fix quitting mainloop in test-networkmanager-service.py
Previously, the callbacks would return gl.mainloop.quit(), which is None and thus the source got removed already. The later GLib.source_remove() would thus use an invalid source-id. Fix that, by no removing the source id from the callback. Fixes: b1ff82eba5e80e4ef3f16e35372ba933c300be1d
Diffstat (limited to 'tools/test-networkmanager-service.py')
-rwxr-xr-xtools/test-networkmanager-service.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py
index 2121bb2b27..fd3c44a0ff 100755
--- a/tools/test-networkmanager-service.py
+++ b/tools/test-networkmanager-service.py
@@ -1392,13 +1392,12 @@ 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
- io = GLib.IOChannel(0)
- id1 = io.add_watch(GLib.IOCondition.HUP,
- lambda io, condition: gl.mainloop.quit())
+ id1 = GLib.IOChannel(0).add_watch(GLib.IOCondition.HUP,
+ lambda io, condition: gl.mainloop.quit() or True)
# also quit after inactivity to ensure we don't stick around if the above fails somehow
id2 = GLib.timeout_add_seconds(20,
- lambda: gl.mainloop.quit())
+ lambda: gl.mainloop.quit() or True)
gl.mainloop.run()