diff --git a/lib/backports/functools_lru_cache.py b/lib/backports/functools_lru_cache.py index e0b19d95..8be4515f 100644 --- a/lib/backports/functools_lru_cache.py +++ b/lib/backports/functools_lru_cache.py @@ -4,7 +4,7 @@ import functools from collections import namedtuple from threading import RLock -_CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"]) +_CacheInfo = namedtuple("_CacheInfo", ["hits", "misses", "maxsize", "currsize"]) @functools.wraps(functools.update_wrapper) @@ -63,7 +63,7 @@ def _make_key( return _HashedSeq(key) -def lru_cache(maxsize=100, typed=False): +def lru_cache(maxsize=100, typed=False): # noqa: C901 """Least-recently-used cache decorator. If *maxsize* is set to None, the LRU features are disabled and the cache @@ -136,7 +136,7 @@ def lru_cache(maxsize=100, typed=False): if link is not None: # record recent use of the key by moving it # to the front of the list - root, = nonlocal_root + (root,) = nonlocal_root link_prev, link_next, key, result = link link_prev[NEXT] = link_next link_next[PREV] = link_prev @@ -148,7 +148,7 @@ def lru_cache(maxsize=100, typed=False): return result result = user_function(*args, **kwds) with lock: - root, = nonlocal_root + (root,) = nonlocal_root if key in cache: # getting here means that this same key was added to the # cache while the lock was released. since the link