diff options
-rw-r--r-- | lib/bb/build.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bb/build.py b/lib/bb/build.py index c2479dd16..18586c276 100644 --- a/lib/bb/build.py +++ b/lib/bb/build.py @@ -298,6 +298,10 @@ def exec_func_python(func, d, runfile, cwd=None): comp = utils.better_compile(code, func, "exec_func_python() autogenerated") utils.better_exec(comp, {"d": d}, code, "exec_func_python() autogenerated") finally: + # We want any stdout/stderr to be printed before any other log messages to make debugging + # more accurate. In some cases we seem to lose stdout/stderr entirely in logging tests without this. + sys.stdout.flush() + sys.stderr.flush() bb.debug(2, "Python function %s finished" % func) if cwd and olddir: |