From ad2f3d420cadc39e2e2313e99f8a11d1829d869a Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Fri, 25 Dec 2015 17:46:37 +0100 Subject: [PATCH] Setting node signatures clears cached values if present --- waflib/Node.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/waflib/Node.py b/waflib/Node.py index 6f945867..2d75d6fe 100644 --- a/waflib/Node.py +++ b/waflib/Node.py @@ -820,11 +820,17 @@ class Node(object): return Utils.h_file(self.abspath()) # -------------------------------------------- - # TODO waf 2.0, remove the cache_sig attribute + # TODO waf 2.0, remove the sig and cache_sig attributes def get_sig(self): return self.h_file() - sig = property(get_sig, Utils.nada) - cache_sig = property(get_sig, Utils.nada) + def set_sig(self, val): + # clear the cache, so that past implementation should still work + try: + del self.get_bld_sig.__cache__[(self,)] + except (AttributeError, KeyError): + pass + sig = property(get_sig, set_sig) + cache_sig = property(get_sig, set_sig) pickle_lock = Utils.threading.Lock() """Lock mandatory for thread-safe node serialization"""