Subject: bug#70815: [PATCH] ; Enahnce python-tests.el to adapt different python interpreters

From: Eli Zaretskii <[email-masked]>
Date: Sat, 11 May 2024 12:05:15 +0300

> From: Lin Sun <[email-masked]>
> Date: Tue, 7 May 2024 06:53:05 +0000
> 
> The python-tests.el will fail on finding interpreter "python" for
> there is no "python"  on CentOS8, Ubuntu 20.04,  only "python3" exists
> after installation.

Thanks, I have some comments, and maybe kobarity will have as well.

> +(defun python-tests-get-shell-interpreter (&optional refresh)

AFAICT, this function is never called with the optional REFRESH
argument non-nil, so why do we need it?

> +  (if (and python-tests-shell-interpreter (null refresh))
> +      python-tests-shell-interpreter
> +    (setq python-tests-shell-interpreter
> +          (or (when-let* ((interpreter (getenv "EMACS_PYTHON_INTERPRETER")))
> +                (or (executable-find interpreter)
> +                    (error "Not found EMACS_PYTHON_INTERPRETER: %s" interpreter)))

Is it indeed useful to error out here?  Should we instead fall back to
the default list, '("python" "python3" "python2") ?

> +              (cl-some #'executable-find '("python" "python3" "python2"))))))

cl-some is in cl-extra, so the test should require it.