mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 01:19:52 +00:00
oeqa/devtool: Avoid unbound variable errors
inherits can be unset resulting in: UnboundLocalError: local variable 'inherits' referenced before assignment which can mask real errors. Avoid this. (From OE-Core rev: 29a0502e101ed0667e960f9f8591b0a2d60a4bcb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -137,6 +137,7 @@ class DevtoolBase(OESelftestTestCase):
|
||||
with open(recipefile, 'r') as f:
|
||||
invar = None
|
||||
invalue = None
|
||||
inherits = set()
|
||||
for line in f:
|
||||
var = None
|
||||
if invar:
|
||||
@@ -158,7 +159,7 @@ class DevtoolBase(OESelftestTestCase):
|
||||
invar = var
|
||||
continue
|
||||
elif line.startswith('inherit '):
|
||||
inherits = line.split()[1:]
|
||||
inherits.update(line.split()[1:])
|
||||
|
||||
if var and var in checkvars:
|
||||
needvalue = checkvars.pop(var)
|
||||
|
||||
Reference in New Issue
Block a user