From 9691600a57ff6fc1a4fad498eaeacf541d3af390 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 8 Sep 2015 15:35:43 +0200 Subject: [PATCH] Import virtualenv so that it uses the same Python version. `/usr/bin/virtualenv` defaults to Python 3 on my system, so running `python2 build.py` failed to install Mercurial. This imports virtualenv so that it runs in and defaults to the same Python version that runs `build.py`. --- build.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 4376a5c..acc3b72 100644 --- a/build.py +++ b/build.py @@ -3,6 +3,8 @@ import subprocess import sys +import virtualenv + import vcs lockfile = None @@ -45,7 +47,7 @@ def setup_virtualenv(): virtualenv_path = os.path.join(here, "_virtualenv") if not os.path.exists(virtualenv_path): - subprocess.check_call(["virtualenv", virtualenv_path]) + virtualenv.create_environment(virtualenv_path) activate_path = os.path.join(virtualenv_path, "bin", "activate_this.py")