Skip to content

Commit 85ace72

Browse files
committed
server(docs[raise_if_dead]): add Raises section for TmuxCommandNotFound
why: PR #636 added a FileNotFoundError→TmuxCommandNotFound path in raise_if_dead but left the docstring documenting only CalledProcessError. what: - Add NumPy-style Raises section before existing doctest - Document TmuxCommandNotFound (missing binary) and CalledProcessError (server not running)
1 parent b728361 commit 85ace72

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/libtmux/server.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,14 @@ def is_alive(self) -> bool:
218218
def raise_if_dead(self) -> None:
219219
"""Raise if server not connected.
220220
221+
Raises
222+
------
223+
:exc:`exc.TmuxCommandNotFound`
224+
When the tmux binary cannot be found or executed.
225+
:class:`subprocess.CalledProcessError`
226+
When the tmux server is not running (non-zero exit from
227+
``list-sessions``).
228+
221229
>>> tmux = Server(socket_name="no_exist")
222230
>>> try:
223231
... tmux.raise_if_dead()

0 commit comments

Comments
 (0)