Skip to content

Commit f78949b

Browse files
LukaszMrugalacarlescufi
authored andcommitted
scripts: twister: Process KeyboardInterrupt Hardening
If you interrupt process() operation, we want Twister to exit as gracefully as it can. This avoids the UnboundLocalError that could appear e.g. when interrupting the operation via SIGINT. Signed-off-by: Lukasz Mrugala <[email protected]>
1 parent 4c6b1e5 commit f78949b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/pylib/twister/twisterlib/runner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,9 @@ def _add_to_pipeline(self, pipeline, op: str, additionals: dict={}):
615615

616616

617617
def process(self, pipeline, done, message, lock, results):
618+
next_op = None
619+
additionals = {}
620+
618621
op = message.get('op')
619622

620623
self.instance.setup_handler(self.env)
@@ -772,8 +775,6 @@ def process(self, pipeline, done, message, lock, results):
772775
done.put(self.instance)
773776
self.report_out(results)
774777

775-
next_op = None
776-
additionals = {}
777778
if not self.options.coverage:
778779
if self.options.prep_artifacts_for_testing:
779780
next_op = 'cleanup'

0 commit comments

Comments
 (0)