Commit 1948e5fe authored by Balazs Lecz's avatar Balazs Lecz
Browse files

Add RemoveDir utility function

Backported from master, 72087dcd

Signed-off-by: default avatarBalazs Lecz <>
Reviewed-by: default avatarIustin Pop <>
Reviewed-by: default avatarGuido Trotter <>
parent 2fd7f564
......@@ -381,6 +381,24 @@ def RemoveFile(filename):
def RemoveDir(dirname):
"""Remove an empty directory.
Remove a directory, ignoring non-existing ones.
Other errors are passed. This includes the case,
where the directory is not empty, so it can't be removed.
@type dirname: str
@param dirname: the empty directory to be removed
except OSError, err:
if err.errno != errno.ENOENT:
def RenameFile(old, new, mkdir=False, mkdir_mode=0750):
"""Renames a file.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment