Not backported because of behaviour change.
\begin{itemize}
-\item Everything is all in the details!
+\item dircache.listdir now passes exceptions to the caller,
+instead of returning empty lists.
\end{itemize}
del cache[path]
except KeyError:
cached_mtime, list = -1, []
- try:
- mtime = os.stat(path).st_mtime
- except os.error:
- return []
+ mtime = os.stat(path).st_mtime
if mtime != cached_mtime:
- try:
- list = os.listdir(path)
- except os.error:
- return []
+ list = os.listdir(path)
list.sort()
cache[path] = mtime, list
return list
self.assert_(dircache.listdir(self.tempdir) is entries)
## UNSUCCESSFUL CASES
- self.assertEquals(dircache.listdir(self.tempdir+"_nonexistent"), [])
+ self.assertRaises(OSError, dircache.listdir, self.tempdir+"_nonexistent")
def test_annotate(self):
self.writeTemp("test2")
Library
-------
+- dircache now passes exceptions to the caller, instead of returning
+ empty lists.
+
- The bsddb module and dbhash module now support the iterator and
mapping protocols which make them more substitutable for dictionaries
and shelves.