This commit is contained in:
Antoine Pitrou 2012-03-17 00:24:12 +01:00
commit 020bf28200
1 changed files with 3 additions and 1 deletions

View File

@ -226,9 +226,11 @@ def lru_cache(maxsize=100, typed=False):
def cache_clear():
"""Clear the cache and cache statistics"""
nonlocal hits, misses
nonlocal hits, misses, root
with lock:
cache.clear()
root = []
root[:] = [root, root, None, None]
hits = misses = 0
wrapper.cache_info = cache_info