From 69a39461de4da2bfc0e6aeeff02c73c0972a8614 Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Thu, 27 Oct 2022 10:19:42 +1300 Subject: MAINT: change subprocess arguments from Python>=3.7 --- numpy/distutils/exec_command.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'numpy/distutils/exec_command.py') diff --git a/numpy/distutils/exec_command.py b/numpy/distutils/exec_command.py index 79998cf5d..a67453abf 100644 --- a/numpy/distutils/exec_command.py +++ b/numpy/distutils/exec_command.py @@ -276,14 +276,13 @@ def _exec_command(command, use_shell=None, use_tee = None, **env): # Inherit environment by default env = env or None try: - # universal_newlines is set to False so that communicate() + # text is set to False so that communicate() # will return bytes. We need to decode the output ourselves # so that Python will not raise a UnicodeDecodeError when # it encounters an invalid character; rather, we simply replace it - proc = subprocess.Popen(command, shell=use_shell, env=env, + proc = subprocess.Popen(command, shell=use_shell, env=env, text=False, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - universal_newlines=False) + stderr=subprocess.STDOUT) except OSError: # Return 127, as os.spawn*() and /bin/sh do return 127, '' -- cgit v1.2.1