summaryrefslogtreecommitdiff
path: root/sphinx/util/osutil.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/util/osutil.py')
-rw-r--r--sphinx/util/osutil.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py
index 0de6d8472..9586306fd 100644
--- a/sphinx/util/osutil.py
+++ b/sphinx/util/osutil.py
@@ -217,3 +217,10 @@ def cd(target_dir):
yield
finally:
os.chdir(cwd)
+
+
+def rmtree(path):
+ if os.path.isdir(path):
+ shutil.rmtree(path)
+ else:
+ os.remove(path)