[Python-checkins] cpython: clear the root with the cache

benjamin.peterson python-checkins at python.org
Sat Mar 17 00:23:04 CET 2012


http://hg.python.org/cpython/rev/087da2a353e6
changeset:   75752:087da2a353e6
parent:      75750:d08f0f3ab23e
user:        Benjamin Peterson <benjamin at python.org>
date:        Fri Mar 16 18:22:26 2012 -0500
summary:
  clear the root with the cache

files:
  Lib/functools.py |  4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Lib/functools.py b/Lib/functools.py
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -227,9 +227,11 @@
 
         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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list