From: Raymond Hettinger Date: Sat, 17 Mar 2012 00:08:37 +0000 (-0700) Subject: Root variable is not changed. X-Git-Tag: v3.3.0a2~136 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f5139ba20a76c0bc9b3dd361cdde27b5abff6a4;p=python Root variable is not changed. --- diff --git a/Lib/functools.py b/Lib/functools.py index 19b7613918..fec4b9e703 100644 --- a/Lib/functools.py +++ b/Lib/functools.py @@ -223,7 +223,7 @@ def lru_cache(maxsize=100, typed=False): def cache_clear(): """Clear the cache and cache statistics""" - nonlocal hits, misses, root + nonlocal hits, misses with lock: cache.clear() root[:] = [root, root, None, None]