mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 06:00:08 +01:00
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: b1ff82eba5
This commit is contained in:
parent
d66b277471
commit
c905ee94f0
1 changed files with 3 additions and 4 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue