Skip to content

Commit e21b80c

Browse files
otherJL0tony
authored andcommitted
Remove redundant casts to int
1 parent bcdbbd6 commit e21b80c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

libtmux/common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def set_environment(self, name, value):
6262
proc = self.cmd(*args)
6363

6464
if proc.stderr:
65-
if isinstance(proc.stderr, list) and len(proc.stderr) == int(1):
65+
if isinstance(proc.stderr, list) and len(proc.stderr) == 1:
6666
proc.stderr = proc.stderr[0]
6767
raise ValueError("tmux set-environment stderr: %s" % proc.stderr)
6868

@@ -83,7 +83,7 @@ def unset_environment(self, name):
8383
proc = self.cmd(*args)
8484

8585
if proc.stderr:
86-
if isinstance(proc.stderr, list) and len(proc.stderr) == int(1):
86+
if isinstance(proc.stderr, list) and len(proc.stderr) == 1:
8787
proc.stderr = proc.stderr[0]
8888
raise ValueError("tmux set-environment stderr: %s" % proc.stderr)
8989

@@ -103,7 +103,7 @@ def remove_environment(self, name):
103103
proc = self.cmd(*args)
104104

105105
if proc.stderr:
106-
if isinstance(proc.stderr, list) and len(proc.stderr) == int(1):
106+
if isinstance(proc.stderr, list) and len(proc.stderr) == 1:
107107
proc.stderr = proc.stderr[0]
108108
raise ValueError("tmux set-environment stderr: %s" % proc.stderr)
109109

libtmux/session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,14 @@ def attached_window(self) -> Window:
322322
if "window_active" in window and window.get("window_active") == "1":
323323
active_windows.append(Window(session=self, **window))
324324

325-
if len(active_windows) == int(1):
325+
if len(active_windows) == 1:
326326
return active_windows[0]
327327
else:
328328
raise exc.LibTmuxException(
329329
"multiple active windows found. %s" % active_windows
330330
)
331331

332-
if len(self._windows) == int(0):
332+
if len(self._windows) == 0:
333333
raise exc.LibTmuxException("No Windows")
334334

335335
def select_window(self, target_window: str) -> Window:

0 commit comments

Comments
 (0)