summaryrefslogtreecommitdiff
path: root/numpy/distutils/exec_command.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2022-10-28 11:30:26 +0200
committerGitHub <noreply@github.com>2022-10-28 11:30:26 +0200
commita8ebbd5fdb9df3d1d2885b24e783757d747dec8e (patch)
treea1dc1bc4915e4231848553ea72dd1b4810a64786 /numpy/distutils/exec_command.py
parenta10b20760610be8e820f695f9889060af1a640b9 (diff)
parent69a39461de4da2bfc0e6aeeff02c73c0972a8614 (diff)
downloadnumpy-a8ebbd5fdb9df3d1d2885b24e783757d747dec8e.tar.gz
Merge pull request #22483 from mwtoews/maint-subprocess
MAINT: change subprocess arguments from Python>=3.7
Diffstat (limited to 'numpy/distutils/exec_command.py')
-rw-r--r--numpy/distutils/exec_command.py7
1 files changed, 3 insertions, 4 deletions
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, ''