diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-12-31 20:43:16 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-31 20:43:16 +0900 |
commit | 1cae50f74833fc3506ebee19462e0a1457638352 (patch) | |
tree | 5e7b9714b84288b1ca04438b73611a78aa4c23df /sphinx/apidoc.py | |
parent | 1b664248f4ed5e00f89574bd6568e86b29a9df0f (diff) | |
parent | 0059c05a857f4144e4eea8b3d2908e906cf7de49 (diff) | |
download | sphinx-git-1cae50f74833fc3506ebee19462e0a1457638352.tar.gz |
Merge branch 'stable' into 4a164170-33e9-4df3-aad2-a13af37b6b43
Diffstat (limited to 'sphinx/apidoc.py')
-rw-r--r-- | sphinx/apidoc.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sphinx/apidoc.py b/sphinx/apidoc.py index 24ed874b0..b764cfc35 100644 --- a/sphinx/apidoc.py +++ b/sphinx/apidoc.py @@ -26,7 +26,7 @@ from fnmatch import fnmatch from sphinx import __display_version__ from sphinx.quickstart import EXTENSIONS from sphinx.util import rst -from sphinx.util.osutil import FileAvoidWrite, walk +from sphinx.util.osutil import FileAvoidWrite, ensuredir, walk if False: # For type annotation @@ -375,9 +375,8 @@ Note: By default this script will not overwrite already created files.""") if not path.isdir(rootpath): print('%s is not a directory.' % rootpath, file=sys.stderr) sys.exit(1) - if not path.isdir(opts.destdir): - if not opts.dryrun: - os.makedirs(opts.destdir) + if not opts.dryrun: + ensuredir(opts.destdir) rootpath = path.abspath(rootpath) excludes = normalize_excludes(rootpath, excludes) modules = recurse_tree(rootpath, excludes, opts) |