Skip to content

Commit bd382df

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 3a6fb89 commit bd382df

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
@@ -73,7 +73,6 @@ def temp_session(
7373
@contextlib.contextmanager
7474
def temp_window(
7575
session: Session,
76-
*args: t.Any,
7776
**kwargs: t.Any,
7877
) -> Generator[Window, t.Any, t.Any]:
7978
"""
@@ -91,8 +90,6 @@ def temp_window(
9190
9291
Other Parameters
9392
----------------
94-
args : list
95-
Arguments passed into :meth:`Session.new_window`
9693
kwargs : dict
9794
Keyword arguments passed into :meth:`Session.new_window`
9895
@@ -117,7 +114,7 @@ def temp_window(
117114
else:
118115
window_name = kwargs.pop("window_name")
119116

120-
window = session.new_window(window_name, *args, **kwargs)
117+
window = session.new_window(window_name, **kwargs)
121118

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

0 commit comments

Comments
 (0)