summaryrefslogtreecommitdiff
path: root/sphinx/config.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-12-20 02:18:56 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-12-20 13:55:35 +0900
commit1977f3fceeab1f9132a5096993f243f1a76fd0f5 (patch)
tree89b070dd52105968f269d379097344371768b3be /sphinx/config.py
parentaae2f199114381e899f5c273749c95944062afd0 (diff)
downloadsphinx-git-1977f3fceeab1f9132a5096993f243f1a76fd0f5.tar.gz
Fix #8549: i18n: ``-D gettext_compact=0`` is no longer working
Since 1bf7fe424, ``-D gettext_compact=0`` is not treated as disabling the feature. It is recognized as creating ``0.pot`` because its type is Any. This changes it to `[bool, str]`.
Diffstat (limited to 'sphinx/config.py')
-rw-r--r--sphinx/config.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/sphinx/config.py b/sphinx/config.py
index b3cd1dc6d..13159d2d2 100644
--- a/sphinx/config.py
+++ b/sphinx/config.py
@@ -180,6 +180,14 @@ class Config:
defvalue = self.values[name][0]
if self.values[name][2] == Any:
return value
+ elif self.values[name][2] == {bool, str}:
+ if value == '0':
+ # given falsy string from command line option
+ return False
+ elif value == '1':
+ return True
+ else:
+ return value
elif type(defvalue) is bool or self.values[name][2] == [bool]:
if value == '0':
# given falsy string from command line option