Skip to content
Snippets Groups Projects
Commit ab775cf2 authored by Campbell Barton's avatar Campbell Barton
Browse files

Fix error in a6707661

Missed prepending Python to the autopep8 command for the version check
parent a6707661
No related branches found
No related tags found
No related merge requests found
...@@ -67,8 +67,13 @@ def autopep8_ensure_version(): ...@@ -67,8 +67,13 @@ def autopep8_ensure_version():
continue continue
else: else:
autopep8_format_cmd = "autopep8" autopep8_format_cmd = "autopep8"
cmd = [autopep8_format_cmd]
if cmd[0].endswith(".py"):
cmd = [sys.executable, *cmd]
try: try:
version_output = subprocess.check_output((autopep8_format_cmd, "--version")).decode('utf-8') version_output = subprocess.check_output((*cmd, "--version")).decode('utf-8')
except FileNotFoundError as e: except FileNotFoundError as e:
continue continue
AUTOPEP8_FORMAT_CMD = autopep8_format_cmd AUTOPEP8_FORMAT_CMD = autopep8_format_cmd
...@@ -83,7 +88,7 @@ def autopep8_ensure_version(): ...@@ -83,7 +88,7 @@ def autopep8_ensure_version():
def autopep8_format(files): def autopep8_format(files):
cmd = [*AUTOPEP8_FORMAT_CMD, "--recursive", "--in-place", "--jobs=0"] + files cmd = [AUTOPEP8_FORMAT_CMD, "--recursive", "--in-place", "--jobs=0"] + files
# Support executing from the module directory because Blender does not distribute the command. # Support executing from the module directory because Blender does not distribute the command.
if cmd[0].endswith(".py"): if cmd[0].endswith(".py"):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment