Patchwork [1,of,2] test-check-interface: do not expect bare "python" executable exists

login
register
mail settings
Submitter Yuya Nishihara
Date Dec. 19, 2020, 3:56 a.m.
Message ID <5db45dfd6206490f8668.1608350199@lemosa>
Download mbox | patch
Permalink /patch/47940/
State Accepted
Headers show

Comments

Yuya Nishihara - Dec. 19, 2020, 3:56 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1608346918 -32400
#      Sat Dec 19 12:01:58 2020 +0900
# Node ID 5db45dfd6206490f8668559838c8888c4d4ca9ac
# Parent  09beb9a133f168111fbef4a729f1c0cc2bfb87ce
test-check-interface: do not expect bare "python" executable exists

The test would crash if python executable had version suffix.
Pulkit Goyal - Dec. 28, 2020, 8:03 a.m.
On Sat, Dec 19, 2020 at 9:26 AM Yuya Nishihara <yuya@tcha.org> wrote:
>
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1608346918 -32400
> #      Sat Dec 19 12:01:58 2020 +0900
> # Node ID 5db45dfd6206490f8668559838c8888c4d4ca9ac
> # Parent  09beb9a133f168111fbef4a729f1c0cc2bfb87ce
> test-check-interface: do not expect bare "python" executable exists
>
> The test would crash if python executable had version suffix.

Queued the series, many thanks!

Patch

diff --git a/tests/test-check-interfaces.py b/tests/test-check-interfaces.py
--- a/tests/test-check-interfaces.py
+++ b/tests/test-check-interfaces.py
@@ -12,7 +12,7 @@  import sys
 
 # Only run if tests are run in a repo
 if subprocess.call(
-    ['python', '%s/hghave' % os.environ['TESTDIR'], 'test-repo']
+    [sys.executable, '%s/hghave' % os.environ['TESTDIR'], 'test-repo']
 ):
     sys.exit(80)