Skip to content

Commit 8af066a

Browse files
committed
ci(shell): Fix exec issue: nested function with free variables
tmuxp/__init__.py:14: in <module> from . import cli, config, util E SyntaxError: unqualified exec is not allowed in function 'command_shell' because it contains a nested function with free variables (cli.py, line 734)
1 parent cefd802 commit 8af066a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tmuxp/cli.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -684,14 +684,14 @@ def command_shell(session_name, window_name, socket_name, socket_path, command):
684684

685685
current_pane = None
686686
if os.getenv('TMUX_PANE') is not None:
687-
current_pane = next(
688-
(
687+
try:
688+
current_pane = [
689689
p
690690
for p in server._list_panes()
691691
if p.get('pane_id') == os.getenv('TMUX_PANE')
692-
),
693-
None,
694-
)
692+
][0]
693+
except IndexError:
694+
pass
695695

696696
try:
697697
if session_name:

0 commit comments

Comments
 (0)