Skip to content

Commit

Permalink
Fix is_bool_flag being set to True even if is_flag is False
Browse files Browse the repository at this point in the history
  • Loading branch information
janluke committed May 24, 2021
1 parent f0bf725 commit 3ea5739
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Version 8.0.2

Unreleased

- Fix ``is_bool_flag`` being always set to ``True`` for boolean options,
even when ``is_flag`` is ``False``. :issue:`1925`


Version 8.0.1
-------------
Expand Down
2 changes: 1 addition & 1 deletion src/click/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2528,7 +2528,7 @@ def __init__(
self.type = types.convert_type(None, flag_value)

self.is_flag: bool = is_flag
self.is_bool_flag = isinstance(self.type, types.BoolParamType)
self.is_bool_flag = is_flag and isinstance(self.type, types.BoolParamType)
self.flag_value: t.Any = flag_value

# Counting
Expand Down

0 comments on commit 3ea5739

Please sign in to comment.