Skip to content

Commit

Permalink
scripts: twister: Fix serial_py referenced before assignment
Browse files Browse the repository at this point in the history
This fixes `serial_py referenced before assignment` if `flash_before`
is set.

Signed-off-by: Armin Kessler <[email protected]>
(cherry picked from commit 78f688a)
  • Loading branch information
epc-ake authored and nashif committed Nov 20, 2024
1 parent 6a50fd3 commit 4404621
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/pylib/twister/twisterlib/hardwaremap.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,14 @@ def load(self, map_file):
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))
platform = dut.get('platform')
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')
Expand Down

0 comments on commit 4404621

Please sign in to comment.