[Python-checkins] bpo-38456: Handle the case when there is no 'true' command (GH-16739)

Pablo Galindo webhook-mailer at python.org
Sat Oct 12 21:40:28 EDT 2019


https://github.com/python/cpython/commit/46113e0cf32748f66cf64cd633984d143b433cd1
commit: 46113e0cf32748f66cf64cd633984d143b433cd1
branch: master
author: Pablo Galindo <Pablogsal at gmail.com>
committer: GitHub <noreply at github.com>
date: 2019-10-13T02:40:24+01:00
summary:

bpo-38456: Handle the case when there is no 'true' command (GH-16739)

files:
M Lib/test/test_subprocess.py

diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 2231ff49235c8..9e96a6d9a8747 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -59,6 +59,8 @@
 
 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



More information about the Python-checkins mailing list