From 447ca17fb19f0bde32d56abcf4d0b55d51313df1 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauld.mccarthy@gmail.com>
Date: Sun, 5 Jun 2016 13:20:40 +0100
Subject: [PATCH] Bugfix in new memoize function - cache needs to be in real
 decorator function.

---
 fsl/utils/memoize.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fsl/utils/memoize.py b/fsl/utils/memoize.py
index c79835d6a..1d6d7b1e2 100644
--- a/fsl/utils/memoize.py
+++ b/fsl/utils/memoize.py
@@ -40,10 +40,11 @@ def memoize(args=None, kwargs=None):
     :arg args:   A list of positional argument indices.
     :arg kwargs: A list of keyword argument names.
     """
-    
-    cache = {}
 
     def decorator(func):
+
+        cache = {}
+ 
         def wrapper(*a, **kwa):
 
             key = []
-- 
GitLab