Skip to contentSkip to conversation

event.py: fix regression about INVALIDCONF

PATCH Superseded Chen Qi 1 participant 1 message Feb 23, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

PATCH 1/1 event.py: fix regression about INVALIDCONF

A previous commit uses __BBHANDLERS_MC to record all handlers, but it does not take into consideration of INVALIDCONF, thus causing regression.

We need to record the name before returned AlreadyRegistered, otherwise, when reparsing due to INVALIDCONF, bascially all handlers are not called.

---
 bitbake/lib/bb/event.py | 4 ++++
 1 file changed, 4 insertions(+)
bitbake/lib/bb/event.py +4 -0
index 23e1f3187b..3e5718395b 100644
@@ -238,6 +238,10 @@ def register(name, handler, mask=None, filename=None, lineno=None, data=None):
 
     # already registered
     if name in _handlers:
+        if data:
+            bbhands_mc = (data.getVar("__BBHANDLERS_MC") or [])
+            bbhands_mc.append(name)
+            data.setVar("__BBHANDLERS_MC", bbhands_mc)
         return AlreadyRegistered
 
     if handler is not None:
Signature · 1 line
2.17.1