Skip to content

Commit dff674e

Browse files
committed
Temporary(fix[temp_window]): Remove non-functional *args parameter
why: Session.new_window() uses keyword-only arguments (has * marker after window_name), so temp_window() could not forward *args. Calling temp_window(session, "positional_arg") would raise TypeError. what: - Remove *args from temp_window() signature - Update docstring to remove args parameter documentation - Remove *args forwarding in session.new_window() call
1 parent 849cbca commit dff674e

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/libtmux/test/temporary.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def temp_session(
7676
@contextlib.contextmanager
7777
def temp_window(
7878
session: Session,
79-
*args: t.Any,
8079
**kwargs: t.Any,
8180
) -> Generator[Window, t.Any, t.Any]:
8281
"""
@@ -94,8 +93,6 @@ def temp_window(
9493
9594
Other Parameters
9695
----------------
97-
args : list
98-
Arguments passed into :meth:`Session.new_window`
9996
kwargs : dict
10097
Keyword arguments passed into :meth:`Session.new_window`
10198
@@ -120,7 +117,7 @@ def temp_window(
120117
else:
121118
window_name = kwargs.pop("window_name")
122119

123-
window = session.new_window(window_name, *args, **kwargs)
120+
window = session.new_window(window_name, **kwargs)
124121

125122
# Get ``window_id`` before returning it, it may be killed within context.
126123
window_id = window.window_id

0 commit comments

Comments
 (0)