From c9ed0327a9c741a1808926b409df29467baf303a Mon Sep 17 00:00:00 2001 From: Christoph Hamsen <37963496+xopham@users.noreply.github.com> Date: Thu, 13 Oct 2022 18:11:15 +0200 Subject: bpo-46364: Use sockets for stdin of asyncio only on AIX (#30596) Signed-off-by: Christoph Hamsen Co-authored-by: July Tikhonov --- Lib/asyncio/unix_events.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Lib/asyncio/unix_events.py') diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index bdffc032e31..9f9b03e0cb2 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -800,12 +800,11 @@ class _UnixSubprocessTransport(base_subprocess.BaseSubprocessTransport): def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs): stdin_w = None - if stdin == subprocess.PIPE: - # Use a socket pair for stdin, since not all platforms + if stdin == subprocess.PIPE and sys.platform.startswith('aix'): + # Use a socket pair for stdin on AIX, since it does not # support selecting read events on the write end of a # socket (which we use in order to detect closing of the - # other end). Notably this is needed on AIX, and works - # just fine on other platforms. + # other end). stdin, stdin_w = socket.socketpair() try: self._proc = subprocess.Popen( -- cgit v1.2.3