]> code.ossystems Code Review - openembedded-core.git/commitdiff
utils: show the actual exception in better_exec
authorChris Larson <chris_larson@mentor.com>
Wed, 22 Dec 2010 19:06:54 +0000 (12:06 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 10 Jan 2011 13:24:04 +0000 (13:24 +0000)
(Bitbake rev: a148e6a63c842ac586ac1dddbd9008f93cdea297)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/utils.py

index a4902931c638eb0b8eb78de526ed7d36d5ac5ac7..5b3710f84fbd048976184e2c176cb1219a6e0602 100644 (file)
@@ -344,16 +344,14 @@ def better_exec(code, context, text, realfile = "<code>"):
         if t in [bb.parse.SkipPackage, bb.build.FuncFailed]:
             raise
 
-        logger.exception("Error executing python function in '%s'", code.co_filename)
-
-        # print the Header of the Error Message
-        logger.error("There was an error when executing a python function in: %s" % code.co_filename)
-        logger.error("Exception:%s Message:%s" % (t, value))
+        import traceback
+        exception = traceback.format_exception_only(t, value)
+        logger.error('Error executing a python function in %s:\n%s',
+                     realfile, ''.join(exception))
 
         # Strip 'us' from the stack (better_exec call)
         tb = tb.tb_next
 
-        import traceback
         textarray = text.split('\n')
         linefailed = traceback.tb_lineno(tb)