bitbake: utils: fix UnboundLocalError when _print_exception raises

PEP 3110 changed how exceptions work. 'e' is unbound
after the 'except' clause. See: https://www.python.org/dev/peps/pep-3110/#semantic-changes

(Bitbake rev: b69e97de53eb172ed730993e3b755debaa26f30d)

Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Chris Laplante
2020-09-08 19:31:50 -04:00
committed by Richard Purdie
parent f738ed43e9
commit 9b2b23d5ec

View File

@@ -402,8 +402,8 @@ def better_exec(code, context, text = None, realfile = "<code>", pythonexception
(t, value, tb) = sys.exc_info()
try:
_print_exception(t, value, tb, realfile, text, context)
except Exception as e:
logger.error("Exception handler error: %s" % str(e))
except Exception as e2:
logger.error("Exception handler error: %s" % str(e2))
e = bb.BBHandledException(e)
raise e