From d1d053cc3f3c02595363015e0bee161e1aa4695c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 2 Mar 2001 13:35:37 +0000 Subject: [PATCH] Patch by Itamar S.T. (SF#305470): add reset() method. --- Lib/dircache.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Lib/dircache.py b/Lib/dircache.py index a999743a8d1..6171ff83fde 100644 --- a/Lib/dircache.py +++ b/Lib/dircache.py @@ -6,10 +6,15 @@ The annotate() routine appends slashes to directories.""" import os -__all__ = ["listdir","opendir","annotate"] +__all__ = ["listdir", "opendir", "annotate", "reset"] cache = {} +def reset(): + """Reset the cache completely.""" + global cache + cache = {} + def listdir(path): """List directory contents, using cache.""" try: