doc/bitbake-user-manual-metadata.rst: fix python task example
PATCH 1/1 doc/bitbake-user-manual-metadata.rst: fix python task example
Fix the old Python 2 print statement, replace it by a bb.plain() call instead. Also replace time by datetime for a slightly simpler example.
[YOCTO #14670]
Reported-by Robert Berger <[email protected]>
Signed-off-by Antonin Godard <[email protected]>
--- doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +2 -2
@@ -1405,8 +1405,8 @@ the task and other tasks. Here is an example that shows how to define a task and declare some dependencies:: python do_printdate () { - import time - print time.strftime('%Y%m%d', time.gmtime()) + import datetime + bb.plain('Date: %s' % (datetime.date.today())) } addtask printdate after do_fetch before do_build
---
base-commit: 136c06e251de68ed64355ec6b47a522ff3a372e3
change-id: 20250404-fix-python-task-example-de3508554c22
Best regards,
Signature · 1 line
Antonin Godard <[email protected]>