diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-11-21 20:29:53 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-21 20:29:53 +0900 |
| commit | c4df9b5de2f57387a23ec5b28f74b5e760040dd6 (patch) | |
| tree | 74891dfa0dcf1f4ffba3c894e19e775a9347df95 /sphinx/cmd/quickstart.py | |
| parent | 45fadf7f77417ba2c43227e3a08107b63f4a27d3 (diff) | |
| parent | 77849f0ef6d80fc636f457c2d8925c4932c406c9 (diff) | |
| download | sphinx-git-c4df9b5de2f57387a23ec5b28f74b5e760040dd6.tar.gz | |
Merge pull request #5640 from jdufresne/makedirs
Simplify ensuredir() with Python3 stdlib features
Diffstat (limited to 'sphinx/cmd/quickstart.py')
| -rw-r--r-- | sphinx/cmd/quickstart.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sphinx/cmd/quickstart.py b/sphinx/cmd/quickstart.py index 934f47b2a..6d2211720 100644 --- a/sphinx/cmd/quickstart.py +++ b/sphinx/cmd/quickstart.py @@ -109,7 +109,7 @@ class ValidationError(Exception): def is_path(x): # type: (unicode) -> unicode x = path.expanduser(x) - if path.exists(x) and not path.isdir(x): + if not path.isdir(x): raise ValidationError(__("Please enter a valid path name.")) return x @@ -405,8 +405,7 @@ def generate(d, overwrite=True, silent=False, templatedir=None): 'version', 'release', 'master'): d[key + '_str'] = d[key].replace('\\', '\\\\').replace("'", "\\'") - if not path.isdir(d['path']): - ensuredir(d['path']) + ensuredir(d['path']) srcdir = d['sep'] and path.join(d['path'], 'source') or d['path'] |
