diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-12-09 17:53:55 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-12-15 16:07:05 +0300 |
commit | ebdd210a6b2d7884f8f1254ce73bceb121761818 (patch) | |
tree | bfefcb0ecb4f32547679145f6346ab45a9f311a0 /sphinx/config.py | |
parent | 2ec6ce85ef781795dcfb63ccef736b33c6ac96a2 (diff) |
Fix #6900: sphinx-build: -D option does not considers 0 and 1 as a boolean value
Diffstat (limited to 'sphinx/config.py')
-rw-r--r-- | sphinx/config.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sphinx/config.py b/sphinx/config.py index cbe04b3ee..ddee765b7 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -217,6 +217,12 @@ class Config: defvalue = self.values[name][0] if self.values[name][2] == Any: return value + elif type(defvalue) is bool or self.values[name][2] == [bool]: + if value == '0': + # given falsy string from command line option + return False + else: + return bool(value) elif isinstance(defvalue, dict): raise ValueError(__('cannot override dictionary config setting %r, ' 'ignoring (use %r to set individual elements)') % |