mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +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:
|
with open(recipefile, 'r') as f:
|
||||||
invar = None
|
invar = None
|
||||||
invalue = None
|
invalue = None
|
||||||
|
inherits = set()
|
||||||
for line in f:
|
for line in f:
|
||||||
var = None
|
var = None
|
||||||
if invar:
|
if invar:
|
||||||
@@ -158,7 +159,7 @@ class DevtoolBase(OESelftestTestCase):
|
|||||||
invar = var
|
invar = var
|
||||||
continue
|
continue
|
||||||
elif line.startswith('inherit '):
|
elif line.startswith('inherit '):
|
||||||
inherits = line.split()[1:]
|
inherits.update(line.split()[1:])
|
||||||
|
|
||||||
if var and var in checkvars:
|
if var and var in checkvars:
|
||||||
needvalue = checkvars.pop(var)
|
needvalue = checkvars.pop(var)
|
||||||
|
|||||||
Reference in New Issue
Block a user