Use current Python interpreter to show updated version

This commit is contained in:
Ivan Kravets
2016-01-13 22:22:55 +02:00
parent 2d42f944cd
commit 54f2f4ce45

View File

@ -35,8 +35,7 @@ def cli():
fg="yellow")
cmds = (
[os.path.normpath(sys.executable),
"-m", "pip", "install", "--upgrade", "platformio"],
["pip", "install", "--upgrade", "platformio"],
["platformio", "--version"]
)
@ -44,11 +43,12 @@ def cli():
r = None
try:
for cmd in cmds:
cmd = [os.path.normpath(sys.executable), "-m"] + cmd
r = None
r = util.exec_command(cmd)
# try pip with disabled cache
if r['returncode'] != 0 and cmd[0] != "platformio":
if r['returncode'] != 0 and cmd[2] == "pip":
cmd.insert(3, "--no-cache-dir")
r = util.exec_command(cmd)