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]>
  • Loading branch information
epc-ake authored and mmahadevan108 committed Oct 31, 2024
1 parent e31bf8b commit 78f688a
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 @@ -258,14 +258,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 78f688a

Please sign in to comment.