Skip to content

Commit c729584

Browse files
authored
fix(Window.__eq__): Return False if type incorrect (#505)
2 parents 4d51e53 + bdb105f commit c729584

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGES

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ $ pip install --user --upgrade --pre libtmux
1414

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

17+
### Improvement
18+
19+
- `Window.__eq__` now returns `False` instead of raising `AssertionError`, thank
20+
you @m1guelperez! (#505)
21+
1722
## libtmux 0.24.1 (2023-11-23)
1823

1924
### Packaging

src/libtmux/window.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,9 @@ def attached_pane(self) -> t.Optional["Pane"]:
552552
# Dunder
553553
#
554554
def __eq__(self, other: object) -> bool:
555-
assert isinstance(other, Window)
556-
return self.window_id == other.window_id
555+
if isinstance(other, Window):
556+
return self.window_id == other.window_id
557+
return False
557558

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

0 commit comments

Comments
 (0)