Skip to content

Commit 6cff1ee

Browse files
committed
fix!(which): Move to shutil.which per libtmux v0.15.0a1
1 parent de153e2 commit 6cff1ee

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

tmuxp/cli/debug_info.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import os
22
import pathlib
33
import platform
4+
import shutil
45
import sys
56

67
import click
78

89
from libtmux import __version__ as libtmux_version
9-
from libtmux.common import get_version, tmux_cmd, which
10+
from libtmux.common import get_version, tmux_cmd
1011

1112
from ..__about__ import __version__
1213
from .utils import tmuxp_echo
@@ -62,7 +63,7 @@ def format_tmux_resp(std_resp):
6263
"tmux version: %s" % get_version(),
6364
"libtmux version: %s" % libtmux_version,
6465
"tmuxp version: %s" % __version__,
65-
"tmux path: %s" % which("tmux"),
66+
"tmux path: %s" % shutil.which("tmux"),
6667
"tmuxp path: %s" % tmuxp_path,
6768
"shell: %s" % os.environ["SHELL"],
6869
output_break(),

tmuxp/cli/load.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
import logging
99
import os
1010
import pathlib
11+
import shutil
1112
import sys
1213
from typing import List
1314

1415
import click
1516
import kaptan
1617

17-
from libtmux.common import has_gte_version, which
18+
from libtmux.common import has_gte_version
1819
from libtmux.server import Server
1920

2021
from .. import config, exc, log, util
@@ -357,7 +358,7 @@ def load_workspace(
357358
colors=colors,
358359
)
359360

360-
which("tmux") # raise exception if tmux not found
361+
shutil.which("tmux") # raise exception if tmux not found
361362

362363
try: # load WorkspaceBuilder object for tmuxp config / tmux server
363364
builder = WorkspaceBuilder(

tmuxp/conftest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
import os
44
import pathlib
5+
import shutil
56
import typing as t
67

78
import pytest
@@ -10,7 +11,6 @@
1011
from _pytest.fixtures import SubRequest
1112

1213
from libtmux import exc
13-
from libtmux.common import which
1414
from libtmux.server import Server
1515
from libtmux.test import TEST_SESSION_PREFIX, get_test_session_name, namer
1616
from tests.fixtures import utils as test_utils
@@ -140,7 +140,7 @@ def add_doctest_fixtures(
140140
request: SubRequest,
141141
doctest_namespace: t.Dict[str, t.Any],
142142
) -> None:
143-
if isinstance(request._pyfuncitem, DoctestItem) and which("tmux"):
143+
if isinstance(request._pyfuncitem, DoctestItem) and shutil.which("tmux"):
144144
doctest_namespace["server"] = request.getfixturevalue("server")
145145
session: "Session" = request.getfixturevalue("session")
146146
doctest_namespace["session"] = session

0 commit comments

Comments
 (0)