main: Fix Python traceback when Ctrl+C'ing a launched app

This commit is contained in:
Bastien Nocera 2024-01-26 12:20:17 +01:00
parent c19bede0d7
commit 19275d52fa

View file

@ -189,8 +189,11 @@ def _launch(args, profile, appid, reason):
# print (f'Got {cookie} for {profile} hold')
with subprocess.Popen(args) as launched_app:
launched_app.wait()
ret = launched_app.returncode
try:
launched_app.wait()
ret = launched_app.returncode
except KeyboardInterrupt:
ret = launched_app.returncode
proxy.ReleaseProfile('(u)', cookie)
return ret