Commit 72087dcd authored by Balazs Lecz's avatar Balazs Lecz
Browse files

Add RemoveDir utility function

Signed-off-by: default avatarBalazs Lecz <>
Reviewed-by: default avatarIustin Pop <>
parent fadc3742
......@@ -645,6 +645,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