mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 07:18:27 +01:00
Use os.devnull + do not check if system exists for os module
This commit is contained in:
@@ -423,5 +423,5 @@ def resolve_output(inp, out):
|
||||
|
||||
|
||||
def is_exec_found(exec_name):
|
||||
cmd = "({}) 2>/dev/null".format(exec_name)
|
||||
return hasattr(os, "system") and os.system(cmd) == 0
|
||||
cmd = "({}) 2>{}".format(exec_name, os.devnull)
|
||||
return os.system(cmd) == 0
|
||||
|
||||
@@ -91,7 +91,7 @@ def test_makedirs_permissions(tmpdir):
|
||||
|
||||
|
||||
def test_is_exec_found_returns_true_when_program_exists():
|
||||
result = utils.is_exec_found("python")
|
||||
result = utils.is_exec_found("echo")
|
||||
assert result is True
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user