From e48e15b0140ea678bebbcf7551a585aab0f717fc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 25 May 2018 21:13:47 +0300 Subject: [PATCH] Fix "memoized" helper when "expire" is not used --- platformio/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platformio/util.py b/platformio/util.py index 49ff8547..ca081c22 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -122,7 +122,8 @@ class memoized(object): def wrapper(*args, **kwargs): key = str(args) + str(kwargs) if (key not in self.cache - or self.cache[key][0] < time.time() - self.expire): + or (self.expire > 0 + and self.cache[key][0] < time.time() - self.expire)): self.cache[key] = (time.time(), func(*args, **kwargs)) return self.cache[key][1]