Skip to content

Commit b680f0e

Browse files
committed
Don't attempt to re-execute Python when there is no Python executable
1 parent d07dbb8 commit b680f0e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/libregrtest/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,11 @@ def _execute_python(self, cmd, environ):
678678

679679
cmd_text = shlex.join(cmd)
680680
try:
681-
print(f"+ {cmd_text}", flush=True)
681+
# Android and iOS run tests in embedded mode.
682+
if not cmd[0]:
683+
raise ValueError("No Python executable is present")
682684

685+
print(f"+ {cmd_text}", flush=True)
683686
if hasattr(os, 'execv') and not MS_WINDOWS:
684687
os.execv(cmd[0], cmd)
685688
# On success, execv() do no return.

0 commit comments

Comments
 (0)