Skip to content

Commit bac4ac0

Browse files
committed
Remove redundant casts to int
1 parent ca54dac commit bac4ac0

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
@@ -58,7 +58,7 @@ def set_environment(self, name, value):
5858
proc = self.cmd(*args)
5959

6060
if proc.stderr:
61-
if isinstance(proc.stderr, list) and len(proc.stderr) == int(1):
61+
if isinstance(proc.stderr, list) and len(proc.stderr) == 1:
6262
proc.stderr = proc.stderr[0]
6363
raise ValueError("tmux set-environment stderr: %s" % proc.stderr)
6464

@@ -79,7 +79,7 @@ def unset_environment(self, name):
7979
proc = self.cmd(*args)
8080

8181
if proc.stderr:
82-
if isinstance(proc.stderr, list) and len(proc.stderr) == int(1):
82+
if isinstance(proc.stderr, list) and len(proc.stderr) == 1:
8383
proc.stderr = proc.stderr[0]
8484
raise ValueError("tmux set-environment stderr: %s" % proc.stderr)
8585

@@ -99,7 +99,7 @@ def remove_environment(self, name):
9999
proc = self.cmd(*args)
100100

101101
if proc.stderr:
102-
if isinstance(proc.stderr, list) and len(proc.stderr) == int(1):
102+
if isinstance(proc.stderr, list) and len(proc.stderr) == 1:
103103
proc.stderr = proc.stderr[0]
104104
raise ValueError("tmux set-environment stderr: %s" % proc.stderr)
105105

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):
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):

0 commit comments

Comments
 (0)