Skip to content

Commit dfd89d0

Browse files
committed
Fix "UnboundLocalError" // Resolve platformio#949
1 parent 6da6265 commit dfd89d0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

get-platformio.py

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

pioinstaller/python.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,13 @@ def find_compatible_pythons(
212212
except UnicodeDecodeError:
213213
pass
214214
except subprocess.CalledProcessError as e: # pylint:disable=bare-except
215+
error = None
215216
try:
216217
error = e.output.decode()
217218
log.debug(error)
218219
except UnicodeDecodeError:
219220
pass
220-
error = error or ""
221-
if "Could not find distutils module" in error:
221+
if error and "Could not find distutils module" in error:
222222
# pylint:disable=line-too-long
223223
raise click.ClickException(
224224
"""Can not install PlatformIO Core due to a missed `distutils` package in your Python installation.

0 commit comments

Comments
 (0)