aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Element.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/Components/Element.py')
-rw-r--r--lib/python/Components/Element.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/python/Components/Element.py b/lib/python/Components/Element.py
index 437d934b..2af57793 100644
--- a/lib/python/Components/Element.py
+++ b/lib/python/Components/Element.py
@@ -8,11 +8,12 @@ from Tools.CList import CList
def cached(f):
name = f.__name__
def wrapper(self):
- if self.cache is None:
+ cache = self.cache
+ if cache is None:
return f(self)
- if name not in self.cache:
- self.cache[name] = (True, f(self))
- return self.cache[name][1]
+ if name not in cache:
+ cache[name] = (True, f(self))
+ return cache[name][1]
return wrapper
class Element(object):