[Toaster] [PATCH] cooker: replace use of map() with list comprehension

Elliot Smith elliot.smith at intel.com
Tue Jun 14 02:04:53 PDT 2016


In Python 3, map() returns an interator rather than a list.
This causes problems for Toaster, which is unable to process
the BuildInit event when it is received. This causes the
build to "hang" from Toaster's point of view.

Replace the call to map() with a list comprehension instead,
which returns the list which Toaster is expecting and enables
builds to register.

Signed-off-by: Elliot Smith <elliot.smith at intel.com>
---
 bitbake/lib/bb/cooker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 0a0b362..204709c 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1367,7 +1367,7 @@ class BBCooker:
 
         # build a list of target:task strings in format
         # ['zlib:do_build', 'mpfr-native:do_build', ...]
-        packages = map(lambda target: "%s:do_%s" % (target, task), targets)
+        packages = ["%s:do_%s" % (target, task) for target in targets]
         bb.event.fire(bb.event.BuildInit(packages), self.expanded_data)
 
         def buildTargetsIdle(server, rq, abort):
-- 
2.7.4



More information about the toaster mailing list