diff --git a/.travis.yml b/.travis.yml index a3f9de81..b6605385 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,12 @@ env: - JEDI_TEST_ENVIRONMENT=35 - JEDI_TEST_ENVIRONMENT=36 +addons: + apt: + packages: + # Required to properly create a virtual environment with system Python 3.4. + - python3.4-venv + matrix: allow_failures: - python: pypy diff --git a/jedi/api/environment.py b/jedi/api/environment.py index cd12702f..de6fb4c6 100644 --- a/jedi/api/environment.py +++ b/jedi/api/environment.py @@ -239,14 +239,11 @@ def _get_executable_path(path, safe=True): """ if os.name == 'nt': - bin_name = 'Scripts' - extension = '.exe' + activate = os.path.join(path, 'Scripts', 'activate.bat') + python = os.path.join(path, 'Scripts', 'python.exe') else: - bin_name = 'bin' - extension = '' - bin_folder = os.path.join(path, bin_name) - activate = os.path.join(bin_folder, 'activate') - python = os.path.join(bin_folder, 'python' + extension) + activate = os.path.join(path, 'bin', 'activate') + python = os.path.join(path, 'bin', 'python') if not all(os.path.exists(p) for p in (activate, python)): raise InvalidPythonEnvironment("One of bin/activate and bin/python is missing.") diff --git a/travis_install.sh b/travis_install.sh index 4dbdcdf5..1142ac3a 100755 --- a/travis_install.sh +++ b/travis_install.sh @@ -1,6 +1,13 @@ #! /usr/bin/env bash set -e +# 3.6 is already installed on Travis but not as root. This is problematic for +# our virtualenv tests because we require the Python used to create a virtual +# environment to be owned by root (or to be in a safe location which is not the +# case here). +sudo chown root: /opt/python/3.6/bin/python +sudo chown root: /opt/python/3.6.3/bin/python + if [[ $JEDI_TEST_ENVIRONMENT == "33" ]]; then VERSION=3.3 DOWNLOAD=1