Skip to content

Commit 2d48917

Browse files
committed
sanitycheck: handle keyboard interrupts
Handle keyboard interrupts (Ctrl-C) and terminate gracefully. Signed-off-by: Anas Nashif <[email protected]>
1 parent a5d16ab commit 2d48917

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/pylib/twister/twisterlib.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3211,8 +3211,13 @@ def execute(self, pipeline, done, results):
32113211
processes.append(p)
32123212
p.start()
32133213

3214-
for p in processes:
3215-
p.join()
3214+
try:
3215+
for p in processes:
3216+
p.join()
3217+
except KeyboardInterrupt:
3218+
logger.info("Execution interrupted")
3219+
for p in processes:
3220+
p.terminate()
32163221

32173222
# FIXME: This needs to move out.
32183223
if self.enable_size_report and not self.cmake_only:

0 commit comments

Comments
 (0)