File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -189,4 +189,5 @@ def test_which(self):
189
189
def test_non_existent_program (self ):
190
190
"""Check for error for non-existent program"""
191
191
192
- self .assertRaises (Exception , utils .which , 'a_very_unlikely_program_name_to_exist_cosmic_ray' )
192
+ with self .assertRaises (RuntimeError ):
193
+ utils .which ('a_very_unlikely_program_name_to_exist_cosmic_ray' )
Original file line number Diff line number Diff line change 3
3
The module contains some commonly functions and classes.
4
4
5
5
"""
6
+ import shutil
6
7
7
8
from bisect import bisect_right
8
9
from contextlib import suppress
9
- from distutils .spawn import find_executable
10
10
from functools import wraps
11
11
from os import environ
12
12
@@ -169,7 +169,7 @@ def which(program):
169
169
:param program: name or program to check for, e.g. 'wget'.
170
170
171
171
"""
172
- path = find_executable (program )
172
+ path = shutil . which (program )
173
173
if not path :
174
174
raise RuntimeError (f'The program { program } is not available.' )
175
175
You can’t perform that action at this time.
0 commit comments