aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-04-20 20:03:43 +0200
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-05-04 09:57:43 +0200
commitd0d0e776cf433ede6711e2c7d5bdf5866381b555 (patch)
tree080f25e7b11f5da4f3cfa05be2e7bfcf4f658ca0
parent2440719d258a97824395532cb4a775752b423f63 (diff)
downloadu-boot-d0d0e776cf433ede6711e2c7d5bdf5866381b555.zip
u-boot-d0d0e776cf433ede6711e2c7d5bdf5866381b555.tar.gz
u-boot-d0d0e776cf433ede6711e2c7d5bdf5866381b555.tar.bz2
tools: fix TestFdtUtil()
Variable old_outdir cannot be used before assignment. The assignment must occur before the try block. tools/dtoc/test_fdt.py:796:26: E0601: Using variable 'old_outdir' before assignment (used-before-assignment) Add missing space in assignment. Fixes: a004f29464d1 ("binman: Tidy up _SetupDtb() to use its own temporary file") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rwxr-xr-xtools/dtoc/test_fdt.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py
index 32fa69c..4fe8d12 100755
--- a/tools/dtoc/test_fdt.py
+++ b/tools/dtoc/test_fdt.py
@@ -784,8 +784,8 @@ class TestFdtUtil(unittest.TestCase):
def test_ensure_compiled_tmpdir(self):
"""Test providing a temporary directory"""
+ old_outdir = tools.outdir
try:
- old_outdir = tools.outdir
tools.outdir= None
tmpdir = tempfile.mkdtemp(prefix='test_fdt.')
dtb = fdt_util.EnsureCompiled(find_dtb_file('dtoc_test_simple.dts'),
@@ -793,7 +793,7 @@ class TestFdtUtil(unittest.TestCase):
self.assertEqual(tmpdir, os.path.dirname(dtb))
shutil.rmtree(tmpdir)
finally:
- tools.outdir= old_outdir
+ tools.outdir = old_outdir
def test_get_phandle_name_offset(self):
val = fdt_util.GetPhandleNameOffset(self.node, 'missing')