diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-01-16 01:03:53 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-01-16 01:03:53 +0900 |
commit | ddcb45dad608c2d93c4a1da9fa17a0d27645e3ab (patch) | |
tree | 0c59aa06c285ac880e98c8fbc62fbfbc7b991f6b /sphinx/cmdline.py | |
parent | cdb31585a834dc38658691ef51236952bd132aa4 (diff) | |
download | sphinx-git-ddcb45dad608c2d93c4a1da9fa17a0d27645e3ab.tar.gz |
Validate -j option is positive
Diffstat (limited to 'sphinx/cmdline.py')
-rw-r--r-- | sphinx/cmdline.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sphinx/cmdline.py b/sphinx/cmdline.py index 365238607..4cf5a07ef 100644 --- a/sphinx/cmdline.py +++ b/sphinx/cmdline.py @@ -94,7 +94,11 @@ def jobs_argument(value): if value == 'auto': return multiprocessing.cpu_count() else: - return int(value) + jobs = int(value) + if jobs <= 0: + raise argparse.ArgumentTypeError('job number should be a positive number') + else: + return jobs def get_parser(): |