]> granicus.if.org Git - python/commitdiff
Patch by Itamar S.T. (SF#305470): add reset() method.
authorGuido van Rossum <guido@python.org>
Fri, 2 Mar 2001 13:35:37 +0000 (13:35 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 2 Mar 2001 13:35:37 +0000 (13:35 +0000)
Lib/dircache.py

index a999743a8d109b2a3c953064ebabd8a04a28de8a..6171ff83fde9aac327ad9377de9c6777c5ca5dc9 100644 (file)
@@ -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: