Skip to contentSkip to conversation

build: create_progress_handler: fix calling 'get' on NoneType

PATCH New Chris Laplante 1 participant 1 message Jul 27, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: create_progress_handler: fix calling 'get' on NoneType

Just use the |resolve| function which already takes care of it.

---
 lib/bb/build.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/build.py +1 -1
index 23b6ee45..d1457b84 100644
@@ -346,7 +346,7 @@ def create_progress_handler(func, progress, logfile, d):
             cls_obj = functools.reduce(resolve, cls.split("."), bb.utils._context)
             if not cls_obj:
                 # Fall-back on __builtins__
-                cls_obj = functools.reduce(lambda x, y: x.get(y), cls.split("."), __builtins__)
+                cls_obj = functools.reduce(resolve, cls.split("."), __builtins__)
             if cls_obj:
                 return cls_obj(d, outfile=logfile, otherargs=otherargs)
             bb.warn('%s: unknown custom progress handler in task progress varflag value "%s", ignoring' % (func, cls))
Signature · 1 line
2.17.1