diff --git a/utils_maintenance/autopep8_format_paths.py b/utils_maintenance/autopep8_format_paths.py index 714a13a..5b17e2b 100644 --- a/utils_maintenance/autopep8_format_paths.py +++ b/utils_maintenance/autopep8_format_paths.py @@ -82,7 +82,11 @@ def autopep8_ensure_version(autopep8_format_cmd_argument): 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(".")) + version_split = version.split(".") + version = (int(version_split[0]), + int(version_split[1]) if len(version_split) > 1 else 0, + int(version_split[2]) if len(version_split) > 2 else 0, + ) if version is not None: print("Using %s (%d.%d.%d)..." % (AUTOPEP8_FORMAT_CMD, version[0], version[1], version[2])) return version