summaryrefslogtreecommitdiff
path: root/sphinx/util/osutil.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-11-01 01:24:12 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-11-01 01:24:12 +0900
commit8b687ac30481e7204677138d8f2f3b49e354963e (patch)
tree7723d959db00959780dc7f9f56c673cd47d7cd97 /sphinx/util/osutil.py
parente8e0f93c3fc7a9f8be4a91c13c6ec49672347a1e (diff)
parentf4d7b2e60e4352aac6e19dad16f39328bf493ff4 (diff)
downloadsphinx-git-8b687ac30481e7204677138d8f2f3b49e354963e.tar.gz
Merge branch '1.8'
Diffstat (limited to 'sphinx/util/osutil.py')
-rw-r--r--sphinx/util/osutil.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py
index 11b082e7d..c7c0b0690 100644
--- a/sphinx/util/osutil.py
+++ b/sphinx/util/osutil.py
@@ -84,9 +84,10 @@ def ensuredir(path):
"""Ensure that a path exists."""
try:
os.makedirs(path)
- except OSError as err:
- # 0 for Jython/Win32
- if err.errno not in [0, EEXIST]:
+ except OSError:
+ # If the path is already an existing directory (not a file!),
+ # that is OK.
+ if not os.path.isdir(path):
raise
@@ -155,7 +156,7 @@ def ustrftime(format, *args):
# type: (unicode, Any) -> unicode
"""[DEPRECATED] strftime for unicode strings."""
warnings.warn('sphinx.util.osutil.ustrtime is deprecated for removal',
- RemovedInSphinx30Warning)
+ RemovedInSphinx30Warning, stacklevel=2)
if not args:
# If time is not specified, try to use $SOURCE_DATE_EPOCH variable