summaryrefslogtreecommitdiff
path: root/sphinx/util/osutil.py
diff options
context:
space:
mode:
authorYoshiki Shibukawa <shibukawa.yoshiki@dena.jp>2016-07-16 00:11:25 +0900
committerYoshiki Shibukawa <shibukawa.yoshiki@dena.jp>2016-07-16 00:11:25 +0900
commite9f5d9666557678b9dbdbc4330cfe1c09bdafc58 (patch)
tree626c5f6a319c0397c3665ed748b3702af42c92c9 /sphinx/util/osutil.py
parent736615c18c56f91beb7525f97ed8dabacc215ec4 (diff)
downloadsphinx-git-e9f5d9666557678b9dbdbc4330cfe1c09bdafc58.tar.gz
fix make clean abort when build dir contains files like .DS_Store.
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 585dc6104..b416a8c1f 100644
--- a/sphinx/util/osutil.py
+++ b/sphinx/util/osutil.py
@@ -213,3 +213,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)