summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-04-20 19:49:47 +0200
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-04-21 08:50:35 +0200
commit9031cb627c8a44c99ac98672e6d75d16bbede57c (patch)
tree38bcaf1c01f697e5980f86974028939638ff35e7 /test
parente2a0a07ed0966dd6121ee7e34ba142f9989a0c70 (diff)
downloadu-boot-9031cb627c8a44c99ac98672e6d75d16bbede57c.tar.gz
u-boot-9031cb627c8a44c99ac98672e6d75d16bbede57c.tar.bz2
u-boot-9031cb627c8a44c99ac98672e6d75d16bbede57c.zip
test: fix launch_efi()
We cannot use old_dtb in the finally block if it has not been assigned before the try block. test/py/tests/test_efi_fit.py:458:30: E0601: Using variable 'old_dtb' before assignment (used-before-assignment) Fixes: 8391f955494e ("test/py: Create a test for launching UEFI binaries from FIT images") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'test')
-rw-r--r--test/py/tests/test_efi_fit.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/py/tests/test_efi_fit.py b/test/py/tests/test_efi_fit.py
index 92d071f783..7b7c98fb04 100644
--- a/test/py/tests/test_efi_fit.py
+++ b/test/py/tests/test_efi_fit.py
@@ -433,11 +433,13 @@ def test_efi_fit_launch(u_boot_console):
sys_arch = cons.config.buildconfig.get('config_sys_arch', '"sandbox"')[1:-1]
is_sandbox = sys_arch == 'sandbox'
+ if is_sandbox:
+ old_dtb = cons.config.dtb
+
try:
if is_sandbox:
# Use our own device tree file, will be restored afterwards.
control_dtb = make_dtb('internal', False)
- old_dtb = cons.config.dtb
cons.config.dtb = control_dtb
# Run tests