Patchwork D9286: tests: use python from environment in test-parseindex2.py

login
register
mail settings
Submitter phabricator
Date Nov. 9, 2020, 6:02 p.m.
Message ID <differential-rev-PHID-DREV-bqfkfwzef4izx6i66p6n-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47561/
State Superseded
Headers show

Comments

phabricator - Nov. 9, 2020, 6:02 p.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Without this, the test starts failing with D9273 <https://phab.mercurial-scm.org/D9273> (the change to
  `pyexename` to be specific).

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9286

AFFECTED FILES
  tests/test-parseindex2.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-parseindex2.py b/tests/test-parseindex2.py
--- a/tests/test-parseindex2.py
+++ b/tests/test-parseindex2.py
@@ -5,6 +5,7 @@ 
 
 from __future__ import absolute_import, print_function
 
+import os
 import struct
 import subprocess
 import sys
@@ -129,7 +130,7 @@ 
         "import sys; sys.hexversion=%s; "
         "import mercurial.cext.parsers" % hexversion
     )
-    cmd = "python -c \"%s\"" % code
+    cmd = "\"%s\" -c \"%s\"" % (os.environ['PYTHON'], code)
     # We need to do these tests inside a subprocess because parser.c's
     # version-checking code happens inside the module init function, and
     # when using reload() to reimport an extension module, "The init function