mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
tools: ratbagdctl.test: if an exception occurs during startup, terminate
Don't leave a ratbagd.devel process hanging if something goes wrong. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -800,8 +800,13 @@ def setUpModule():
|
||||
ratbagd_process = toolbox.start_ratbagd()
|
||||
assert ratbagd_process is not None
|
||||
|
||||
ratbagd = toolbox.open_ratbagd(ratbagd_process)
|
||||
assert ratbagd is not None
|
||||
try:
|
||||
ratbagd = toolbox.open_ratbagd(ratbagd_process)
|
||||
assert ratbagd is not None
|
||||
except Exception as e:
|
||||
if ratbagd_process is not None:
|
||||
toolbox.terminate_ratbagd(ratbagd_process)
|
||||
raise e
|
||||
|
||||
parser = toolbox.get_parser()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user