cooker: fix UnboundLocalError when exception occurs during parsing

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

(Bitbake rev: 1ae0181ba49ccfcb2d889de5dd1d8912b9e49157)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2012-05-30 17:17:15 +01:00 committed by Richard Purdie
parent 64f88bf5d9
commit f0809ed788
1 changed files with 2 additions and 0 deletions

View File

@ -1646,6 +1646,8 @@ class CookerParser(object):
yield result
def parse_next(self):
result = []
parsed = None
try:
parsed, result = self.results.next()
except StopIteration: