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.

(cherry picked from commit 78f688a)

Original-Signed-off-by: Armin Kessler <[email protected]>
GitOrigin-RevId: 78f688a
Cr-Build-Id: 8732478031671813841
Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8732478031671813841
Copybot-Job-Name: zephyr-main-copybot-downstream
Change-Id: I7fd0d843783f2d00085c9b999c498c8e7ffac89a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5984633
Reviewed-by: Ting Shen <[email protected]>
Commit-Queue: Ting Shen <[email protected]>
Tested-by: ChromeOS Prod (Robot) <[email protected]>
  • Loading branch information
epc-ake authored and Chromeos LUCI committed Nov 1, 2024
1 parent ca8b756 commit 7fb5ec8
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 7fb5ec8

Please sign in to comment.