summaryrefslogtreecommitdiff
path: root/sphinx/util/osutil.py
diff options
context:
space:
mode:
authorJeroen Demeyer <jdemeyer@cage.ugent.be>2018-10-16 10:40:40 +0200
committerJeroen Demeyer <jdemeyer@cage.ugent.be>2018-10-17 12:21:30 +0200
commita7d950ad580eb1feab5094b59857c2eebb8a8976 (patch)
tree1d10eb8ed36a42b34649cbe1c840065538f2f709 /sphinx/util/osutil.py
parentc584b71b128e2ddc0fa1d7f76bbe68217cc64c50 (diff)
downloadsphinx-git-a7d950ad580eb1feab5094b59857c2eebb8a8976.tar.gz
Fix ensuredir() in case of pre-existing file
Diffstat (limited to 'sphinx/util/osutil.py')
-rw-r--r--sphinx/util/osutil.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py
index 4c75009ee..f3b11b267 100644
--- a/sphinx/util/osutil.py
+++ b/sphinx/util/osutil.py
@@ -89,8 +89,9 @@ def ensuredir(path):
try:
os.makedirs(path)
except OSError as err:
- # 0 for Jython/Win32
- if err.errno not in [0, EEXIST]:
+ # If the path is already an existing directory (not a file!),
+ # that is OK.
+ if not os.path.isdir(path):
raise