summaryrefslogtreecommitdiff
path: root/Lib/dircache.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-03-02 13:35:37 +0000
committerGuido van Rossum <guido@python.org>2001-03-02 13:35:37 +0000
commitf27be4bb5ec5f561e11ac98b8149a135a7630627 (patch)
treef7180e3c5df9bf5e6a5ef9a53b75259cd36c45da /Lib/dircache.py
parenta49779c635313e56d732ae0c04a61ae6e38f84d8 (diff)
downloadcpython-f27be4bb5ec5f561e11ac98b8149a135a7630627.tar.gz
Patch by Itamar S.T. (SF#305470): add reset() method.
Diffstat (limited to 'Lib/dircache.py')
-rw-r--r--Lib/dircache.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/dircache.py b/Lib/dircache.py
index a999743a8d..6171ff83fd 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: