summarylogtreecommitdiffstats
path: root/0052-msys-monkeypatch-os-system-via-sh-exe.patch
diff options
context:
space:
mode:
authoratomlong2021-08-28 11:19:04 +0800
committeratomlong2021-08-28 13:15:13 +0800
commit89a67c05174951d172252b1db96ff93cc4ec4bcd (patch)
treed8c39fa79b201cf9aea28c51e7446a252ed8fee4 /0052-msys-monkeypatch-os-system-via-sh-exe.patch
parentcf8d8d8771493a2aa8370ed323d06dc733a84181 (diff)
downloadaur-89a67c05174951d172252b1db96ff93cc4ec4bcd.tar.gz
Update to 3.9.6
Diffstat (limited to '0052-msys-monkeypatch-os-system-via-sh-exe.patch')
-rw-r--r--0052-msys-monkeypatch-os-system-via-sh-exe.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/0052-msys-monkeypatch-os-system-via-sh-exe.patch b/0052-msys-monkeypatch-os-system-via-sh-exe.patch
new file mode 100644
index 000000000000..185b77473043
--- /dev/null
+++ b/0052-msys-monkeypatch-os-system-via-sh-exe.patch
@@ -0,0 +1,39 @@
+From 2cafb98ac994c8befe0d053e6e1524af8ec6e180 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
+ <alexey.pawlow@gmail.com>
+Date: Thu, 17 Jun 2021 18:51:57 +0530
+Subject: [PATCH 052/N] msys monkeypatch os system via sh exe
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Co-authored-by: Алексей <alexey.pawlow@gmail.com>
+---
+ setup.py | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/setup.py b/setup.py
+index d8fc413..20fff27 100644
+--- a/setup.py
++++ b/setup.py
+@@ -58,6 +58,17 @@ def get_platform():
+ return sys.platform
+
+
++# On MSYS, os.system needs to be wrapped with sh.exe
++# as otherwise all the io redirection will fail.
++# Arguably, this could happen inside the real os.system
++# rather than this monkey patch.
++if sys.platform == "win32" and "MSYSTEM" in os.environ:
++ os_system = os.system
++ def msys_system(command):
++ command_in_sh = 'sh.exe -c "%s"' % command.replace("\\", "\\\\")
++ return os_system(command_in_sh)
++ os.system = msys_system
++
+ CROSS_COMPILING = ("_PYTHON_HOST_PLATFORM" in os.environ)
+ HOST_PLATFORM = get_platform()
+ MS_WINDOWS = (HOST_PLATFORM == 'win32')
+--
+2.32.0
+