[oe-commits] [bitbake] 01/02: build.py: add unhandled exception information to the logger when executing python tasks

git at git.openembedded.org git at git.openembedded.org
Tue Feb 12 22:02:35 UTC 2019


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

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

commit 8da9242702fbef8cf3156b95a1076802e0f653c7
Author: Alexander Kanavin <alex.kanavin at gmail.com>
AuthorDate: Mon Feb 11 15:13:01 2019 +0100

    build.py: add unhandled exception information to the logger when executing python tasks
    
    Previously this information was simply discarded, which in some cases
    resulted in generic, unhelpful failures.
    
    With this change the user would see what the exception is, but
    without ugly tracebacks or bulky, irrelevant information from the log file.
    
    Signed-off-by: Alexander Kanavin <alex.kanavin at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/build.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/bb/build.py b/lib/bb/build.py
index 3e2a94e..7571421 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -304,9 +304,10 @@ def exec_func_python(func, d, runfile, cwd=None, pythonexception=False):
         utils.better_exec(comp, {"d": d}, code, "exec_python_func() autogenerated", pythonexception=pythonexception)
     except (bb.parse.SkipRecipe, bb.build.FuncFailed):
         raise
-    except:
+    except Exception as e:
         if pythonexception:
             raise
+        logger.error(str(e))
         raise FuncFailed(func, None)
     finally:
         bb.debug(2, "Python function %s finished" % func)

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


More information about the Openembedded-commits mailing list