Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 954cf57

Browse files
committed
clear the root with the cache
1 parent 01feaec commit 954cf57

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/functools.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,11 @@ def cache_info():
227227

228228
def cache_clear():
229229
"""Clear the cache and cache statistics"""
230-
nonlocal hits, misses
230+
nonlocal hits, misses, root
231231
with lock:
232232
cache.clear()
233+
root = []
234+
root[:] = [root, root, None, None]
233235
hits = misses = 0
234236

235237
wrapper.cache_info = cache_info

0 commit comments

Comments
 (0)