Skip to content

Commit

Permalink
fix(Window.__eq__): Return False if type incorrect (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
tony authored Nov 25, 2023
2 parents 4d51e53 + bdb105f commit c729584
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ $ pip install --user --upgrade --pre libtmux

<!-- Maintainers and contributors: Insert change notes for the next release above -->

### Improvement

- `Window.__eq__` now returns `False` instead of raising `AssertionError`, thank
you @m1guelperez! (#505)

## libtmux 0.24.1 (2023-11-23)

### Packaging
Expand Down
5 changes: 3 additions & 2 deletions src/libtmux/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,9 @@ def attached_pane(self) -> t.Optional["Pane"]:
# Dunder
#
def __eq__(self, other: object) -> bool:
assert isinstance(other, Window)
return self.window_id == other.window_id
if isinstance(other, Window):
return self.window_id == other.window_id
return False

def __repr__(self) -> str:
return "{}({} {}:{}, {})".format(
Expand Down

0 comments on commit c729584

Please sign in to comment.