diff --git a/src/build/property_set.py b/src/build/property_set.py index a8f8597ea..19d2c27df 100644 --- a/src/build/property_set.py +++ b/src/build/property_set.py @@ -12,9 +12,11 @@ import b2.build.feature from b2.exceptions import * from b2.util.sequence import unique from b2.util.set import difference +from b2.util import cached from b2.manager import get_manager + def reset (): """ Clear the module state. This is mainly for testing purposes. """ @@ -427,7 +429,7 @@ class PropertySet: return self.feature_map_.get(feature, []) - # FIXME: make this cached + @cached def get_properties(self, feature): """Returns all contained properties associated with 'feature'""" diff --git a/src/util/__init__.py b/src/util/__init__.py index 99d34cdd0..a53988f3b 100644 --- a/src/util/__init__.py +++ b/src/util/__init__.py @@ -30,7 +30,10 @@ class cached(object): except KeyError: v = self.function(*args) self.cache[args] = v - return v + return v + + def __get__(self, instance, type): + return types.MethodType(self, instance, type) def unquote(s): if s and s[0] == '"' and s[-1] == '"':