From 408416a842f30bd7d00852a3150af9d22b9f8fda Mon Sep 17 00:00:00 2001 From: Joseph Nix Date: Tue, 4 Dec 2018 12:48:16 -0600 Subject: [PATCH] [lektor-619] Fixing https://github.com/lektor/lektor/issues/619, cuased by https://github.com/pypa/virtualenv/issues/1241 --- assets/install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/assets/install.sh b/assets/install.sh index 98332b6e..38d27c70 100644 --- a/assets/install.sh +++ b/assets/install.sh @@ -24,7 +24,7 @@ if 1: import json import tempfile import shutil - from subprocess import Popen + from subprocess import CalledProcessError, check_output, Popen try: from urllib.request import urlopen except ImportError: @@ -121,7 +121,10 @@ if 1: os.makedirs(lib_dir) except OSError: pass - Popen([sys.executable, './virtualenv.py', lib_dir], cwd=t).wait() + try: + check_output([sys.executable, './src/virtualenv.py', lib_dir], cwd=t) + except CalledProcessError: # virtualenv 16.1.0, 17+ + Popen([sys.executable, './virtualenv.py', lib_dir], cwd=t).wait() Popen([os.path.join(lib_dir, 'bin', 'pip'), 'install', '--upgrade', 'Lektor']).wait() os.symlink(os.path.join(lib_dir, 'bin', 'lektor'),