From: Daan De Meyer Date: Tue, 18 Feb 2025 10:06:43 +0000 (+0100) Subject: run: Wait for child process in try block in spawn() X-Git-Tag: v26~372 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b07bf6ddef931f58d117161e266a020c689708c2;p=thirdparty%2Fmkosi.git run: Wait for child process in try block in spawn() If we only wait in finally block then any keyboard interrupt triggered during the wait will leave the child process alive and won't wait for it to exit. Let's make sure this doesn't happen by waiting in the try block as well. --- diff --git a/mkosi/run.py b/mkosi/run.py index 928634e36..57b3ef468 100644 --- a/mkosi/run.py +++ b/mkosi/run.py @@ -227,6 +227,7 @@ def spawn( try: yield proc + proc.wait() except KeyboardInterrupt: proc.send_signal(signal.SIGINT) raise