Skip to content

Commit

Permalink
Merge pull request #901 from sphinx-contrib/cleanup-bool-configuratio…
Browse files Browse the repository at this point in the history
…n-validation

config: cleanup bool cfg validation
  • Loading branch information
jdknight authored Mar 3, 2024
2 parents e96bf0a + 43b34c8 commit 2f2a094
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sphinxcontrib/confluencebuilder/config/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ def bool(self):
value = self._value()

if value is not None:
if isinstance(value, str) or isinstance(value, int):
if isinstance(value, (int, str)):
try:
str2bool(value)
except ValueError as ex:
msg = f'{self.key} is not a boolean string'
raise ConfluenceConfigError(msg) from ex
elif not isinstance(value, bool) and not isinstance(value, int):
elif not isinstance(value, bool):
msg = f'{self.key} is not a boolean type'
raise ConfluenceConfigError(msg)

Expand Down

0 comments on commit 2f2a094

Please sign in to comment.