.. module:: dircache
:synopsis: Return directory listing, with cache mechanism.
+ :deprecated:
+
+.. deprecated:: 2.6
+ The dircache module has been removed in Python 3.0.
+
+
.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
The listdir() routine returns a sorted list of the files in a directory,
using a cache to avoid reading the directory more often than necessary.
The annotate() routine appends slashes to directories."""
+from warnings import warnpy3k
+warnpy3k("the dircache module has been removed in Python 3.0", stacklevel=2)
+del warnpy3k
import os
def dash_R_cleanup(fs, ps, pic, abcs):
import gc, copy_reg
- import _strptime, linecache, dircache
+ import _strptime, linecache
+ dircache = test_support.import_module('dircache', deprecated=True)
import urlparse, urllib, urllib2, mimetypes, doctest
import struct, filecmp
from distutils.dir_util import _path_created
"""
import unittest
-from test.test_support import run_unittest, TESTFN
-import dircache, os, time, sys, tempfile
+from test.test_support import run_unittest, TESTFN, import_module
+dircache = import_module('dircache', deprecated=True)
+import os, time, sys, tempfile
class DircacheTests(unittest.TestCase):
def test_main():
- run_unittest(DircacheTests)
+ try:
+ run_unittest(DircacheTests)
+ finally:
+ dircache.reset()
if __name__ == "__main__":
# test.testall not tested as it executes all unit tests as an
# import side-effect.
all_platforms = ('audiodev', 'imputil', 'mutex', 'user', 'new', 'rexec',
- 'Bastion', 'compiler')
+ 'Bastion', 'compiler', 'dircache')
inclusive_platforms = {'irix':('pure',)}
# XXX Don't know if lib-tk is only installed if _tkinter is built.
optional_modules = ('bsddb185', 'Canvas')