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 <lukaszx.mrugala@intel.com>
This commit is contained in:
Lukasz Mrugala 2024-09-12 07:58:34 +00:00 committed by Carles Cufí
commit f78949b18c

View file

@ -615,6 +615,9 @@ class ProjectBuilder(FilterBuilder):
def process(self, pipeline, done, message, lock, results):
next_op = None
additionals = {}
op = message.get('op')
self.instance.setup_handler(self.env)
@ -772,8 +775,6 @@ class ProjectBuilder(FilterBuilder):
done.put(self.instance)
self.report_out(results)
next_op = None
additionals = {}
if not self.options.coverage:
if self.options.prep_artifacts_for_testing:
next_op = 'cleanup'