mirror of
https://github.com/godotengine/godot.git
synced 2024-10-23 05:31:54 +00:00
Windows/detect.py: Simplify try_cmd function
This commit is contained in:
parent
108c603f91
commit
3a0837b74b
|
@ -21,10 +21,14 @@ def get_name():
|
||||||
|
|
||||||
|
|
||||||
def try_cmd(test, prefix, arch):
|
def try_cmd(test, prefix, arch):
|
||||||
|
archs = ["x86_64", "x86_32", "arm64", "arm32"]
|
||||||
if arch:
|
if arch:
|
||||||
|
archs = [arch]
|
||||||
|
|
||||||
|
for a in archs:
|
||||||
try:
|
try:
|
||||||
out = subprocess.Popen(
|
out = subprocess.Popen(
|
||||||
get_mingw_bin_prefix(prefix, arch) + test,
|
get_mingw_bin_prefix(prefix, a) + test,
|
||||||
shell=True,
|
shell=True,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
|
@ -34,20 +38,6 @@ def try_cmd(test, prefix, arch):
|
||||||
return True
|
return True
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
|
||||||
for a in ["x86_64", "x86_32", "arm64", "arm32"]:
|
|
||||||
try:
|
|
||||||
out = subprocess.Popen(
|
|
||||||
get_mingw_bin_prefix(prefix, a) + test,
|
|
||||||
shell=True,
|
|
||||||
stderr=subprocess.PIPE,
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
)
|
|
||||||
out.communicate()
|
|
||||||
if out.returncode == 0:
|
|
||||||
return True
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user