Windows/detect.py: Simplify try_cmd function
This commit is contained in:
parent
108c603f91
commit
3a0837b74b
1 changed files with 5 additions and 15 deletions
|
@ -21,21 +21,11 @@ def get_name():
|
|||
|
||||
|
||||
def try_cmd(test, prefix, arch):
|
||||
archs = ["x86_64", "x86_32", "arm64", "arm32"]
|
||||
if arch:
|
||||
try:
|
||||
out = subprocess.Popen(
|
||||
get_mingw_bin_prefix(prefix, arch) + test,
|
||||
shell=True,
|
||||
stderr=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
)
|
||||
out.communicate()
|
||||
if out.returncode == 0:
|
||||
return True
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
for a in ["x86_64", "x86_32", "arm64", "arm32"]:
|
||||
archs = [arch]
|
||||
|
||||
for a in archs:
|
||||
try:
|
||||
out = subprocess.Popen(
|
||||
get_mingw_bin_prefix(prefix, a) + test,
|
||||
|
|
Loading…
Reference in a new issue