clear the root with the cache

This commit is contained in:
Benjamin Peterson 2012-03-16 18:22:26 -05:00
parent 01feaecbfa
commit 954cf578c7

View file

@ -227,9 +227,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