From 64431c31bf0a01052ea3d5583765d1624b963c7b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Sun, 16 Sep 2012 18:23:31 +0200 Subject: [PATCH] cache_result w/o "timeout" param --- mygpo/cache.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mygpo/cache.py b/mygpo/cache.py index b2896634..4a7124cf 100644 --- a/mygpo/cache.py +++ b/mygpo/cache.py @@ -23,8 +23,10 @@ def cache_result(**cache_kwargs): name = f.__module__ + f.func_name key = create_key(name, args, kwargs) + # the timeout parameter can't be used when getting from a cache get_kwargs = dict(cache_kwargs) - get_kwargs.pop('timeout') + get_kwargs.pop('timeout', None) + value = cache.get(key, NOT_IN_CACHE, **get_kwargs) if value is NOT_IN_CACHE: -- 2.11.4.GIT