Commit 4404621e authored by Armin Kessler's avatar Armin Kessler Committed by Anas Nashif
Browse files

scripts: twister: Fix serial_py referenced before assignment

This fixes `serial_py referenced before assignment` if `flash_before`
is set.

Signed-off-by: default avatarArmin Kessler <ake@espros.com>
(cherry picked from commit 78f688a3)
parent 6a50fd3c
Loading
Loading
Loading
Loading
+1 −1
Changes for scripts/pylib/twister/twisterlib/hardwaremap.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -234,6 +234,7 @@ class HardwareMap:
            flash_with_test = dut.get('flash_with_test')
            if flash_with_test is None:
                flash_with_test = self.options.device_flash_with_test
            serial_pty = dut.get('serial_pty')
            flash_before = dut.get('flash_before')
            if flash_before is None:
                flash_before = self.options.flash_before and (not (flash_with_test or serial_pty))
@@ -241,7 +242,6 @@ class HardwareMap:
            id = dut.get('id')
            runner = dut.get('runner')
            runner_params = dut.get('runner_params')
            serial_pty = dut.get('serial_pty')
            serial = dut.get('serial')
            baud = dut.get('baud', None)
            product = dut.get('product')