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

Skip to content

Commit d1d053c

Browse files
committed
Patch by Itamar S.T. (SF#305470): add reset() method.
1 parent 53a7906 commit d1d053c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Lib/dircache.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@
66

77
import os
88

9-
__all__ = ["listdir","opendir","annotate"]
9+
__all__ = ["listdir", "opendir", "annotate", "reset"]
1010

1111
cache = {}
1212

13+
def reset():
14+
"""Reset the cache completely."""
15+
global cache
16+
cache = {}
17+
1318
def listdir(path):
1419
"""List directory contents, using cache."""
1520
try:

0 commit comments

Comments
 (0)