Bug #1343671: clarify docs for os.removedirs
This commit is contained in:
parent
c1d2f7b6ad
commit
69cb3cde1a
|
@ -931,11 +931,15 @@ Availability: Macintosh, \UNIX, Windows.
|
||||||
\index{directory!deleting}
|
\index{directory!deleting}
|
||||||
Removes directories recursively. Works like
|
Removes directories recursively. Works like
|
||||||
\function{rmdir()} except that, if the leaf directory is
|
\function{rmdir()} except that, if the leaf directory is
|
||||||
successfully removed, directories corresponding to rightmost path
|
successfully removed, \function{removedirs()}
|
||||||
segments will be pruned way until either the whole path is consumed or
|
tries to successively remove every parent directory mentioned in
|
||||||
an error is raised (which is ignored, because it generally means that
|
\var{path} until an error is raised (which is ignored, because
|
||||||
a parent directory is not empty). Throws an \exception{error}
|
it generally means that a parent directory is not empty).
|
||||||
exception if the leaf directory could not be successfully removed.
|
For example, \samp{os.removedirs('foo/bar/baz')} will first remove
|
||||||
|
the directory \samp{'foo/bar/baz'}, and then remove \samp{'foo/bar'}
|
||||||
|
and \samp{'foo'} if they are empty.
|
||||||
|
Raises \exception{OSError} if the leaf directory could not be
|
||||||
|
successfully removed.
|
||||||
\versionadded{1.5.2}
|
\versionadded{1.5.2}
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue