summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredia Huya-Kouadio <fhuyakou@gmail.com>2022-08-31 12:36:54 -0700
committerFredia Huya-Kouadio <fhuyakou@gmail.com>2022-08-31 13:02:23 -0700
commit667f4ed742e0010adb678dff45e004310c4886d4 (patch)
tree6cfeab5e31085cd1ad516004b04b2e089a9feb19
parent736632ee7ed00a3474448cfd227f696f82905ac7 (diff)
Fix build failures for Android on Windows
The issue is caused by https://github.com/godotengine/godot/pull/64306 which makes use of a 3.7 feature while the current recommended python version is 3.5 for 3.x and 3.6 for master.
-rw-r--r--methods.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/methods.py b/methods.py
index 3a00aa12ca..649072d098 100644
--- a/methods.py
+++ b/methods.py
@@ -412,16 +412,17 @@ def use_windows_spawn_fix(self, platform=None):
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
- proc = subprocess.Popen(
- cmdline,
- stdin=subprocess.PIPE,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- startupinfo=startupinfo,
- shell=False,
- env=env,
- text=True,
- )
+ popen_args = {
+ "stdin": subprocess.PIPE,
+ "stdout": subprocess.PIPE,
+ "stderr": subprocess.PIPE,
+ "startupinfo": startupinfo,
+ "shell": False,
+ "env": env,
+ }
+ if sys.version_info >= (3, 7, 0):
+ popen_args["text"] = True
+ proc = subprocess.Popen(cmdline, **popen_args)
_, err = proc.communicate()
rv = proc.wait()
if rv: