summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/data_smart.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/data_smart.py')
-rw-r--r--bitbake/lib/bb/data_smart.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index fe0bacd13b..0128a5bb17 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -154,19 +154,20 @@ class VariableParse:
154 return str(value) 154 return str(value)
155 155
156class DataContext(dict): 156class DataContext(dict):
157 excluded = set([i for i in dir(builtins) if not i.startswith('_')] + ['bb', 'os', 'oe']) 157 excluded = set([i for i in dir(builtins) if not i.startswith('_')] + ['oe'])
158 158
159 def __init__(self, metadata, **kwargs): 159 def __init__(self, metadata, **kwargs):
160 self.metadata = metadata 160 self.metadata = metadata
161 dict.__init__(self, **kwargs) 161 dict.__init__(self, **kwargs)
162 self['d'] = metadata 162 self['d'] = metadata
163 self.context = set(bb.utils.get_context())
163 164
164 def __missing__(self, key): 165 def __missing__(self, key):
165 if key in self.excluded: 166 if key in self.excluded or key in self.context:
166 raise KeyError(key) 167 raise KeyError(key)
167 168
168 value = self.metadata.getVar(key) 169 value = self.metadata.getVar(key)
169 if value is None or self.metadata.getVarFlag(key, 'func', False): 170 if value is None:
170 raise KeyError(key) 171 raise KeyError(key)
171 else: 172 else:
172 return value 173 return value