Skip to content

Commit

Permalink
Fix minor type error.
Browse files Browse the repository at this point in the history
Comparing self to `0` caused a minor panic in Mypy.
  • Loading branch information
HexDecimal committed Jun 21, 2023
1 parent 8e7dd8b commit 16a8f8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcod/event.py
Expand Up @@ -279,7 +279,7 @@ class MouseButtonMask(enum.IntFlag):
"""Forward mouse button is held."""

def __repr__(self) -> str:
if self == 0:
if self.value == 0:
return f"{self.__class__.__name__}(0)"
return "|".join(f"{self.__class__.__name__}.{self.__class__(bit).name}" for bit in self.__class__ if bit & self)

Expand Down

0 comments on commit 16a8f8b

Please sign in to comment.