Skip to content

Commit 7f2d7bd

Browse files
refactor: using shutil which instead of distutils
1 parent 4f60547 commit 7f2d7bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

system/lib/pvr_tex_tool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
# Note: a solution from
1717
# https://stackoverflow.com/questions/11210104/check-if-a-program-exists-from-a-python-script
1818
def _get_executable_path(*paths: str) -> str | None:
19-
from distutils.spawn import find_executable
19+
from shutil import which
2020

2121
for path in paths:
22-
executable_path = find_executable(path)
22+
executable_path = which(path)
2323
if executable_path is not None:
2424
return path
2525

2626
return None
2727

2828

2929
_cli_name = "PVRTexToolCLI"
30-
_cli_path = _get_executable_path(_cli_name, f"{_main_dir}/system/bin/{_cli_name}")
30+
_cli_path = _get_executable_path(f"{_main_dir}/system/bin/{_cli_name}", _cli_name)
3131

3232

3333
def can_use_pvr_tex_tool() -> bool:

0 commit comments

Comments
 (0)