From 54f2f4ce45934ecfdf71371f26e9530f384257a1 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 13 Jan 2016 22:22:55 +0200 Subject: [PATCH] Use current Python interpreter to show updated version --- platformio/commands/upgrade.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio/commands/upgrade.py b/platformio/commands/upgrade.py index 83520fc2..ba318018 100644 --- a/platformio/commands/upgrade.py +++ b/platformio/commands/upgrade.py @@ -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)