Patchwork [bitbake-devel,2/5] cooker: fix UnboundLocalError when exception occurs during parsing

login
register
mail settings
Submitter Paul Eggleton
Date May 30, 2012, 4:17 p.m.
Message ID <655fd33cfb85ab8da287081f457ecf9ebcc226be.1338394341.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/28953/
State New
Headers show

Comments

Paul Eggleton - May 30, 2012, 4:17 p.m.
Fix a recent regression where we see the following additional error
after an error occurs during parsing:

ERROR: Command execution failed: Traceback (most recent call last):
  File "/home/paul/poky/poky/bitbake/lib/bb/command.py", line 84, in runAsyncCommand
    self.cooker.updateCache()
  File "/home/paul/poky/poky/bitbake/lib/bb/cooker.py", line 1202, in updateCache
    if not self.parser.parse_next():
  File "/home/paul/poky/poky/bitbake/lib/bb/cooker.py", line 1672, in parse_next
    self.virtuals += len(result)
UnboundLocalError: local variable 'result' referenced before assignment

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/lib/bb/cooker.py |    2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index d1de757..b30945c 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1646,6 +1646,8 @@  class CookerParser(object):
                     yield result
 
     def parse_next(self):
+        result = []
+        parsed = None
         try:
             parsed, result = self.results.next()
         except StopIteration: