summaryrefslogtreecommitdiff
path: root/sphinx/config.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-12-09 23:53:55 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2019-12-15 22:07:05 +0900
commitebdd210a6b2d7884f8f1254ce73bceb121761818 (patch)
treebfefcb0ecb4f32547679145f6346ab45a9f311a0 /sphinx/config.py
parent2ec6ce85ef781795dcfb63ccef736b33c6ac96a2 (diff)
downloadsphinx-git-ebdd210a6b2d7884f8f1254ce73bceb121761818.tar.gz
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.py6
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)') %