diff --git a/lib/core/decorators.py b/lib/core/decorators.py index 31ce7535a..ab8978c1a 100644 --- a/lib/core/decorators.py +++ b/lib/core/decorators.py @@ -13,7 +13,10 @@ def cachedmethod(f, cache={}): """ def _(*args, **kwargs): - key = (f, tuple(args), str(kwargs)) + try: + key = (f, tuple(args), frozenset(kwargs.items())) + except: + key = "".join(str(_) for _ in (f, args, kwargs)) if key not in cache: cache[key] = f(*args, **kwargs) return cache[key]