mirror of https://github.com/python/cpython
bpo-38456: Handle the case when there is no 'true' command (GH-16739)
This commit is contained in:
parent
27b33fb41a
commit
46113e0cf3
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue