diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py index 79d591a237..0cd41683d9 100644 --- a/bitbake/lib/bb/data_smart.py +++ b/bitbake/lib/bb/data_smart.py @@ -784,13 +784,14 @@ class DataSmart(MutableMapping): if match: removes.extend(self.expand(r).split()) - filtered = filter(lambda v: v not in removes, - value.split()) - value = " ".join(filtered) - if expand and var in self.expand_cache: - # We need to ensure the expand cache has the correct value - # flag == "_content" here - self.expand_cache[var].value = value + if removes: + filtered = filter(lambda v: v not in removes, + value.split()) + value = " ".join(filtered) + if expand and var in self.expand_cache: + # We need to ensure the expand cache has the correct value + # flag == "_content" here + self.expand_cache[var].value = value return value def delVarFlag(self, var, flag, **loginfo):