File tree Expand file tree Collapse file tree 3 files changed +1
-17
lines changed Expand file tree Collapse file tree 3 files changed +1
-17
lines changed Original file line number Diff line number Diff line change 16
16
from grandalf .routing import route_with_lines
17
17
18
18
from dvc .env import DVC_PAGER
19
- from dvc .utils import is_exec_found
20
19
21
20
22
21
logger = logging .getLogger (__name__ )
@@ -32,7 +31,7 @@ def find_pager():
32
31
if not sys .stdout .isatty ():
33
32
return pydoc .plainpager
34
33
35
- if is_exec_found ( DEFAULT_PAGER ) :
34
+ if os . system ( "({}) 2>{}" . format ( DEFAULT_PAGER , os . devnull )) == 0 :
36
35
pager_cmd = os .getenv (DVC_PAGER , DEFAULT_PAGER_FORMATTED )
37
36
38
37
def less_pager (text ):
Original file line number Diff line number Diff line change @@ -420,8 +420,3 @@ def resolve_output(inp, out):
420
420
if os .path .isdir (out ):
421
421
return os .path .join (out , name )
422
422
return out
423
-
424
-
425
- def is_exec_found (exec_name ):
426
- cmd = "({}) 2>{}" .format (exec_name , os .devnull )
427
- return os .system (cmd ) == 0
Original file line number Diff line number Diff line change @@ -88,13 +88,3 @@ def test_makedirs_permissions(tmpdir):
88
88
89
89
assert stat .S_IMODE (os .stat (test_dir ).st_mode ) == dir_mode
90
90
assert stat .S_IMODE (os .stat (intermediate_dir ).st_mode ) == dir_mode
91
-
92
-
93
- def test_is_exec_found_returns_true_when_program_exists ():
94
- result = utils .is_exec_found ("echo" )
95
- assert result is True
96
-
97
-
98
- def test_is_exec_found_returns_false_when_program_is_missing ():
99
- result = utils .is_exec_found ("some-missing-program" )
100
- assert result is False
You can’t perform that action at this time.
0 commit comments