]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
BBHandler: Ensure parser state engine is correctly reset for new parsing
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 7 Dec 2012 13:10:51 +0000 (13:10 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 7 Dec 2012 17:12:57 +0000 (17:12 +0000)
The classes variable in particular could be in an odd state if parsing of a
previous recipe had abruptly ended.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/parse/parse_py/BBHandler.py

index 2e0647b5df27afbb3e7ebb87e1f4306478d82c82..c4e579d073ee9e56c3bb18e3230bf10718afa649 100644 (file)
@@ -107,14 +107,15 @@ def get_statements(filename, absolute_filename, base_name):
         return statements
 
 def handle(fn, d, include):
-    global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __residue__
+    global __func_start_regexp__, __inherit_regexp__, __export_func_regexp__, __addtask_regexp__, __addhandler_regexp__, __infunc__, __body__, __residue__, __inpython__, classes
     __body__ = []
     __infunc__ = ""
     __classname__ = ""
     __residue__ = []
-
+    __inpython__ = False
 
     if include == 0:
+        classes = [ None, ]
         logger.debug(2, "BB %s: handle(data)", fn)
     else:
         logger.debug(2, "BB %s: handle(data, include)", fn)