Skip to content

Commit

Permalink
Config(): Fix bool comparison to match types (mypy --strict)
Browse files Browse the repository at this point in the history
MyPy warning was:

    src/waybar_check_gmail/config/config.py:73:20:73:46: error: Non-overlapping identity check (left operand type: "Union[str, bool, None]", right operand type: "Type[bool]")  [comparison-overlap]
                        if self._map[sec][key] is bool:
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    Found 1 error in 1 file (checked 1 source file)
  • Loading branch information
trinitronx committed Aug 11, 2023
1 parent 4c3a973 commit f5c3673
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/waybar_check_gmail/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __init__(self, fn: AnyPath):
for key, val in config.items(sec):
if key not in self._map[sec]:
die("Unexpected config key in section {}: {}".format(sec, key))
if self._map[sec][key] is bool:
if isinstance(self._map[sec][key], bool):
self._map[sec][key] = config.getboolean(sec, key)
else:
self._map[sec][key] = val
Expand Down

0 comments on commit f5c3673

Please sign in to comment.