Kaydet (Commit) 954cf578 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

clear the root with the cache

üst 01feaecb
...@@ -227,9 +227,11 @@ def lru_cache(maxsize=100, typed=False): ...@@ -227,9 +227,11 @@ def lru_cache(maxsize=100, typed=False):
def cache_clear(): def cache_clear():
"""Clear the cache and cache statistics""" """Clear the cache and cache statistics"""
nonlocal hits, misses nonlocal hits, misses, root
with lock: with lock:
cache.clear() cache.clear()
root = []
root[:] = [root, root, None, None]
hits = misses = 0 hits = misses = 0
wrapper.cache_info = cache_info wrapper.cache_info = cache_info
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment