]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: vboot: Using variable 'old_dtb' before assignment
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 11 Dec 2023 18:07:33 +0000 (19:07 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 13 Dec 2023 23:39:06 +0000 (18:39 -0500)
old_dtb can only be assumed initialized in the finally block
if it is assigned a value before the try statement.

Avoid a pylint error reported by current pylint.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
test/py/tests/test_vboot.py

index 04fa59f98b0e8540cb0729383b34547a249faae2..7e0e8e4475060aa0ffbc57a83b441ee0b6954018 100644 (file)
@@ -533,10 +533,10 @@ def test_vboot(u_boot_console, name, sha_algo, padding, sign_options, required,
     with open(evil_kernel, 'wb') as fd:
         fd.write(500 * b'\x01')
 
+    # We need to use our own device tree file. Remember to restore it
+    # afterwards.
+    old_dtb = cons.config.dtb
     try:
-        # We need to use our own device tree file. Remember to restore it
-        # afterwards.
-        old_dtb = cons.config.dtb
         cons.config.dtb = dtb
         if global_sign:
             test_global_sign(sha_algo, padding, sign_options)