summaryrefslogtreecommitdiffstats
path: root/Lib/functools.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-03-16 23:22:26 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-03-16 23:22:26 (GMT)
commit954cf578c760e2b9e0fe9b3eedcfd3d1bfc7f7ec (patch)
treeb79d6a117411a86be2e4d9c9f9ccb6e46b287831 /Lib/functools.py
parent01feaecbfa37ad85b8ae51c8c7743e1ce8d5a92f (diff)
downloadcpython-954cf578c760e2b9e0fe9b3eedcfd3d1bfc7f7ec.zip
cpython-954cf578c760e2b9e0fe9b3eedcfd3d1bfc7f7ec.tar.gz
cpython-954cf578c760e2b9e0fe9b3eedcfd3d1bfc7f7ec.tar.bz2
clear the root with the cache
Diffstat (limited to 'Lib/functools.py')
-rw-r--r--Lib/functools.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/functools.py b/Lib/functools.py
index af24f42..3455d7c 100644
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -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