]> granicus.if.org Git - python/commitdiff
bpo-38456: Handle the case when there is no 'true' command (GH-16739)
authorPablo Galindo <Pablogsal@gmail.com>
Sun, 13 Oct 2019 01:40:24 +0000 (02:40 +0100)
committerGitHub <noreply@github.com>
Sun, 13 Oct 2019 01:40:24 +0000 (02:40 +0100)
Lib/test/test_subprocess.py

index 2231ff49235c8f39ad42771276704610d69e8e01..9e96a6d9a87474fe5b8343fcedb10ae0e7d25830 100644 (file)
@@ -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