[oe-commits] [openembedded-core] 01/02: oeqa/devtool: Avoid unbound variable errors

git at git.openembedded.org git at git.openembedded.org
Mon Nov 18 15:48:37 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit edade24ff202254df905d5a23accc7160f12e7ed
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Mon Nov 18 15:20:13 2019 +0000

    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.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/selftest/cases/devtool.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 3a25da2..f4b303b 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -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)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list