[bitbake-devel] [PATCH 1/2] cooker.py: the var cre maybe undefined

Robert Yang liezhi.yang at windriver.com
Wed Jan 17 08:52:50 UTC 2018


The cre is not defined when re.compile(regex) raise errors, move the code where
use it to the try block to fix the problem.

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
---
 lib/bb/cooker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 28717f4..ebfed0d 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1173,11 +1173,11 @@ class BBCooker:
                 else:
                     try:
                         cre = re.compile(regex)
+                        self.bbfile_config_priorities.append((c, regex, cre, collection_priorities[c]))
                     except re.error:
                         parselog.error("BBFILE_PATTERN_%s \"%s\" is not a valid regular expression", c, regex)
                         errors = True
                         continue
-                self.bbfile_config_priorities.append((c, regex, cre, collection_priorities[c]))
         if errors:
             # We've already printed the actual error(s)
             raise CollectionError("Errors during parsing layer configuration")
-- 
2.7.4




More information about the bitbake-devel mailing list