]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: fit: Using variable 'old_dtb' before assignment
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 11 Dec 2023 18:07:32 +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_fit.py

index f45848484eb0f332d063e7c7727d5652701945ce..04f64fd4bc6318259895878ab321895e2ba318ea 100755 (executable)
@@ -390,10 +390,10 @@ def test_fit(u_boot_console):
 
 
     cons = u_boot_console
+    # 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
         mkimage = cons.config.build_dir + '/tools/mkimage'
         run_fit_test(mkimage)
     finally: