Skip to content

Commit 269c1d7

Browse files
committed
fix(tmux_cmd): simpler trim lines in stdout
1 parent 0995d26 commit 269c1d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: libtmux/common.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ def __init__(self, *args: t.Any, **kwargs: t.Any) -> None:
271271
stdout_str = console_to_str(stdout)
272272
stdout_split = stdout_str.split("\n")
273273
# remove trailing newlines from stdout
274-
for i in range(len(stdout_split)-1, -1, -1):
275-
if stdout_split[i] == '':
276-
stdout_split.pop(i)
274+
for v in reversed(stdout_split):
275+
if v == '':
276+
stdout_split.pop()
277277
else:
278278
break
279279

0 commit comments

Comments
 (0)