mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-17 22:49:02 +00:00
binman: elf: Using variable 'old_val' before assignment
old_val can only be assumed initialized in the finally block if it is assigned a value before the try statement. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
aafbe1daa5
commit
ace49c7df7
1 changed files with 4 additions and 4 deletions
|
@ -249,8 +249,8 @@ class TestElf(unittest.TestCase):
|
|||
|
||||
def testEmbedFail(self):
|
||||
"""Test calling GetSymbolFileOffset() without elftools"""
|
||||
old_val = elf.ELF_TOOLS
|
||||
try:
|
||||
old_val = elf.ELF_TOOLS
|
||||
elf.ELF_TOOLS = False
|
||||
fname = self.ElfTestFile('embed_data')
|
||||
with self.assertRaises(ValueError) as e:
|
||||
|
@ -290,8 +290,8 @@ class TestElf(unittest.TestCase):
|
|||
|
||||
def test_read_segments_fail(self):
|
||||
"""Test for read_loadable_segments() without elftools"""
|
||||
old_val = elf.ELF_TOOLS
|
||||
try:
|
||||
old_val = elf.ELF_TOOLS
|
||||
elf.ELF_TOOLS = False
|
||||
fname = self.ElfTestFile('embed_data')
|
||||
with self.assertRaises(ValueError) as e:
|
||||
|
@ -327,8 +327,8 @@ class TestElf(unittest.TestCase):
|
|||
|
||||
def test_get_file_offset_fail(self):
|
||||
"""Test calling GetFileOffset() without elftools"""
|
||||
old_val = elf.ELF_TOOLS
|
||||
try:
|
||||
old_val = elf.ELF_TOOLS
|
||||
elf.ELF_TOOLS = False
|
||||
fname = self.ElfTestFile('embed_data')
|
||||
with self.assertRaises(ValueError) as e:
|
||||
|
@ -351,8 +351,8 @@ class TestElf(unittest.TestCase):
|
|||
|
||||
def test_get_symbol_from_address_fail(self):
|
||||
"""Test calling GetSymbolFromAddress() without elftools"""
|
||||
old_val = elf.ELF_TOOLS
|
||||
try:
|
||||
old_val = elf.ELF_TOOLS
|
||||
elf.ELF_TOOLS = False
|
||||
fname = self.ElfTestFile('embed_data')
|
||||
with self.assertRaises(ValueError) as e:
|
||||
|
|
Loading…
Add table
Reference in a new issue