Merge pull request #258 from meunierd/expanduser

Allow specifying python version relative to user's home directory.
This commit is contained in:
Anthony Sottile
2015-08-13 11:32:28 -07:00
2 changed files with 17 additions and 0 deletions

View File

@@ -31,8 +31,11 @@ def in_env(repo_cmd_runner, language_version):
def norm_version(version):
version = os.path.expanduser(version)
if os.name == 'nt': # pragma: no cover (windows)
if not distutils.spawn.find_executable(version):
# expanduser introduces a leading slash
version = version.strip('\\')
# The default place for python on windows is:
# C:\PythonXX\python.exe
version = r'C:\{0}\python.exe'.format(version.replace('.', ''))