forked from platformio/platformio-core
Improve support for Python 3.6
This commit is contained in:
@ -53,16 +53,15 @@ def cli(dev, verbose):
|
||||
subprocess.run(
|
||||
[python_exe, "-m", "pip", "install", "--upgrade", pkg_spec],
|
||||
check=True,
|
||||
capture_output=not verbose,
|
||||
stdout=subprocess.PIPE if not verbose else None,
|
||||
)
|
||||
r = subprocess.run(
|
||||
output = subprocess.run(
|
||||
[python_exe, "-m", "platformio", "--version"],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
assert "version" in r.stdout
|
||||
actual_version = r.stdout.split("version", 1)[1].strip()
|
||||
stdout=subprocess.PIPE,
|
||||
).stdout.decode()
|
||||
assert "version" in output
|
||||
actual_version = output.split("version", 1)[1].strip()
|
||||
click.secho(
|
||||
"PlatformIO has been successfully upgraded to %s" % actual_version,
|
||||
fg="green",
|
||||
|
@ -29,8 +29,10 @@ class ShellType(Enum):
|
||||
|
||||
|
||||
def get_bash_version():
|
||||
result = subprocess.run(["bash", "--version"], capture_output=True, check=True)
|
||||
match = re.search(r"version\s+(\d+)\.(\d+)", result.stdout.decode(), re.IGNORECASE)
|
||||
output = subprocess.run(
|
||||
["bash", "--version"], check=True, stdout=subprocess.PIPE
|
||||
).stdout.decode()
|
||||
match = re.search(r"version\s+(\d+)\.(\d+)", output, re.IGNORECASE)
|
||||
if match:
|
||||
return (int(match.group(1)), int(match.group(2)))
|
||||
return (0, 0)
|
||||
|
Reference in New Issue
Block a user