mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-18 08:43:37 +00:00
Update functools_lru_cache 1.6.1 (2dc65b5) → 1.6.2 (2405ed1).
This commit is contained in:
parent
c24d19beda
commit
53c403876d
2 changed files with 5 additions and 4 deletions
|
@ -10,6 +10,7 @@
|
||||||
* Update chardet packages 4.0.0 (b3d867a) to 5.1.0 (8087f00)
|
* Update chardet packages 4.0.0 (b3d867a) to 5.1.0 (8087f00)
|
||||||
* Update diskcache 5.1.0 (40ce0de) to 5.4.0 (1cb1425)
|
* Update diskcache 5.1.0 (40ce0de) to 5.4.0 (1cb1425)
|
||||||
* Update feedparser 6.0.1 (98d189fa) to 6.0.10 (5fcb3ae)
|
* Update feedparser 6.0.1 (98d189fa) to 6.0.10 (5fcb3ae)
|
||||||
|
* Update functools_lru_cache 1.6.1 (2dc65b5) to 1.6.2 (2405ed1)
|
||||||
* Update humanize 3.5.0 (b6b0ea5) to 4.0.0 (a1514eb)
|
* Update humanize 3.5.0 (b6b0ea5) to 4.0.0 (a1514eb)
|
||||||
* Update Js2Py 0.70 (92250a4) to 0.74 (2e017b8)
|
* Update Js2Py 0.70 (92250a4) to 0.74 (2e017b8)
|
||||||
* Update pyjsparser 2.7.1 (5465d03) to 2.7.1 (cbd1e05)
|
* Update pyjsparser 2.7.1 (5465d03) to 2.7.1 (cbd1e05)
|
||||||
|
|
|
@ -4,7 +4,7 @@ import functools
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from threading import RLock
|
from threading import RLock
|
||||||
|
|
||||||
_CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"])
|
_CacheInfo = namedtuple("_CacheInfo", ["hits", "misses", "maxsize", "currsize"])
|
||||||
|
|
||||||
|
|
||||||
@functools.wraps(functools.update_wrapper)
|
@functools.wraps(functools.update_wrapper)
|
||||||
|
@ -63,7 +63,7 @@ def _make_key(
|
||||||
return _HashedSeq(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.
|
"""Least-recently-used cache decorator.
|
||||||
|
|
||||||
If *maxsize* is set to None, the LRU features are disabled and the cache
|
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:
|
if link is not None:
|
||||||
# record recent use of the key by moving it
|
# record recent use of the key by moving it
|
||||||
# to the front of the list
|
# to the front of the list
|
||||||
root, = nonlocal_root
|
(root,) = nonlocal_root
|
||||||
link_prev, link_next, key, result = link
|
link_prev, link_next, key, result = link
|
||||||
link_prev[NEXT] = link_next
|
link_prev[NEXT] = link_next
|
||||||
link_next[PREV] = link_prev
|
link_next[PREV] = link_prev
|
||||||
|
@ -148,7 +148,7 @@ def lru_cache(maxsize=100, typed=False):
|
||||||
return result
|
return result
|
||||||
result = user_function(*args, **kwds)
|
result = user_function(*args, **kwds)
|
||||||
with lock:
|
with lock:
|
||||||
root, = nonlocal_root
|
(root,) = nonlocal_root
|
||||||
if key in cache:
|
if key in cache:
|
||||||
# getting here means that this same key was added to the
|
# getting here means that this same key was added to the
|
||||||
# cache while the lock was released. since the link
|
# cache while the lock was released. since the link
|
||||||
|
|
Loading…
Reference in a new issue