]> code.ossystems Code Review - openembedded-core.git/commitdiff
Add & utilize a simple_exec utility function
authorChris Larson <chris_larson@mentor.com>
Wed, 31 Mar 2010 15:52:41 +0000 (08:52 -0700)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 2 Jul 2010 14:41:31 +0000 (15:41 +0100)
(Bitbake rev: 5ead16f14f996bcbb2fb14277b8ce5a9317b8160)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/event.py
bitbake/lib/bb/utils.py

index 8559858f0428fd88b28a9bcd309989c4e08b2b8a..f49f71cf7129e845664a48f7d6b798a83ad013f2 100644 (file)
@@ -58,7 +58,7 @@ def fire_class_handlers(event, d):
         event.data = d
         if type(h).__name__ == "code":
             locals = {"e": event}
-            exec h in bb.utils._context, locals
+            bb.utils.simple_exec(h, locals)
             bb.utils.better_eval("tmpHandler(e)", locals)
         else:
             h(event)
index 50e9402a2ba1ba946054f9e1f516153be18b78bd..2e3937ec122806558ce892070be32328fd76d6fe 100644 (file)
@@ -222,6 +222,9 @@ def better_exec(code, context, text, realfile):
         
         raise
 
+def simple_exec(code, context):
+    exec code in _context, context
+
 def better_eval(source, locals):
     return eval(source, _context, locals)