File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
3
import re
4
- from distutils .spawn import find_executable
5
4
from itertools import chain
5
+ from shutil import which
6
6
from subprocess import CalledProcessError , check_call , check_output
7
7
8
8
@@ -23,9 +23,9 @@ def get_rpath(self, file_name: str) -> str:
23
23
def _verify_patchelf () -> None :
24
24
"""This function looks for the ``patchelf`` external binary in the PATH,
25
25
checks for the required version, and throws an exception if a proper
26
- version can't be found. Otherwise, silcence is golden
26
+ version can't be found. Otherwise, silence is golden
27
27
"""
28
- if not find_executable ("patchelf" ):
28
+ if not which ("patchelf" ):
29
29
raise ValueError ("Cannot find required utility `patchelf` in PATH" )
30
30
try :
31
31
version = check_output (["patchelf" , "--version" ]).decode ("utf-8" )
Original file line number Diff line number Diff line change 8
8
from auditwheel .patcher import Patchelf
9
9
10
10
11
- @patch ("auditwheel.patcher.find_executable " )
12
- def test_patchelf_unavailable (find_executable ):
13
- find_executable .return_value = False
11
+ @patch ("auditwheel.patcher.which " )
12
+ def test_patchelf_unavailable (which ):
13
+ which .return_value = False
14
14
with pytest .raises (ValueError ):
15
15
Patchelf ()
16
16
You can’t perform that action at this time.
0 commit comments