summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-10-13 01:40:24 (GMT)
committerGitHub <noreply@github.com>2019-10-13 01:40:24 (GMT)
commit46113e0cf32748f66cf64cd633984d143b433cd1 (patch)
tree1d384df701344e4a090ef690654318d989af0e98
parent27b33fb41a7c64a6211d73d14804aa0cd6defccb (diff)
downloadcpython-46113e0cf32748f66cf64cd633984d143b433cd1.zip
cpython-46113e0cf32748f66cf64cd633984d143b433cd1.tar.gz
cpython-46113e0cf32748f66cf64cd633984d143b433cd1.tar.bz2
bpo-38456: Handle the case when there is no 'true' command (GH-16739)
-rw-r--r--Lib/test/test_subprocess.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 2231ff4..9e96a6d 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -59,6 +59,8 @@ ZERO_RETURN_CMD = (sys.executable, '-c', 'pass')
def setUpModule():
shell_true = shutil.which('true')
+ if shell_true is None:
+ return
if (os.access(shell_true, os.X_OK) and
subprocess.run([shell_true]).returncode == 0):
global ZERO_RETURN_CMD