Skip to content
Snippets Groups Projects
Commit ccc8fceb authored by Dalai Felinto's avatar Dalai Felinto
Browse files

autopep8 parser: Fix parser when no autopep8 is installed

Differential Revision: https://developer.blender.org/D14983
parent b1d5eea3
No related branches found
Tags
No related merge requests found
......@@ -68,6 +68,7 @@ def autopep8_ensure_version(autopep8_format_cmd_argument):
global AUTOPEP8_FORMAT_CMD
autopep8_format_cmd = None
version_output = None
version = None
# Attempt to use `--autopep8-command` passed in from `make format`
# so the autopep8 distributed with Blender will be used.
for is_default in (True, False):
......@@ -90,7 +91,8 @@ def autopep8_ensure_version(autopep8_format_cmd_argument):
continue
AUTOPEP8_FORMAT_CMD = autopep8_format_cmd
break
version = next(iter(v for v in version_output.split() if v[0].isdigit()), None)
if version_output is not None:
version = next(iter(v for v in version_output.split() if v[0].isdigit()), None)
if version is not None:
version = version.split("-")[0]
version = tuple(int(n) for n in version.split("."))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment