summaryrefslogtreecommitdiff
path: root/sphinx/cmd/quickstart.py
diff options
context:
space:
mode:
authorRaymond Sun <raymondsun33@gmail.com>2021-06-14 15:57:50 +1000
committerRaymond Sun <raymondsun33@gmail.com>2021-06-14 16:15:50 +1000
commit6a9cc9e5ea9a8baca2e289ed1f2c925e6e610ea3 (patch)
treed44233e4527d8e8b6331fbb07158813195a3fa8a /sphinx/cmd/quickstart.py
parentc9aefa4a26aa4c1e81a1e53ae1ddd6f4f54970ee (diff)
downloadsphinx-git-6a9cc9e5ea9a8baca2e289ed1f2c925e6e610ea3.tar.gz
Fix flake8 errors
Diffstat (limited to 'sphinx/cmd/quickstart.py')
-rw-r--r--sphinx/cmd/quickstart.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/sphinx/cmd/quickstart.py b/sphinx/cmd/quickstart.py
index 359355ad1..7dfc29e19 100644
--- a/sphinx/cmd/quickstart.py
+++ b/sphinx/cmd/quickstart.py
@@ -95,6 +95,12 @@ def is_path(x: str) -> str:
return x
+def is_path_or_empty(x: str) -> str:
+ if x == '':
+ return x
+ return is_path(x)
+
+
def allow_empty(x: str) -> str:
return x
@@ -222,7 +228,10 @@ def ask_user(d: Dict) -> None:
'selected root path.')))
print(__('sphinx-quickstart will not overwrite existing Sphinx projects.'))
print()
- sys.exit(1)
+ d['path'] = do_prompt(__('Please enter a new root path (or just Enter to exit)'),
+ '', is_path_or_empty)
+ if not d['path']:
+ sys.exit(1)
if 'sep' not in d:
print()