X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/ea55ff28782f7e3b481c99faaf9f57e88597bdde..c9689b80fbb108316b0330fc1ed444ccab419b02:/blackd.py diff --git a/blackd.py b/blackd.py index 25a9a15..37fcec3 100644 --- a/blackd.py +++ b/blackd.py @@ -129,7 +129,11 @@ def parse_python_variant_header(value: str) -> Tuple[bool, Set[black.TargetVersi for version in value.split(","): if version.startswith("py"): version = version[len("py") :] - major_str, *rest = version.split(".") + if "." in version: + major_str, *rest = version.split(".") + else: + major_str = version[0] + rest = [version[1:]] if len(version) > 1 else [] try: major = int(major_str) if major not in (2, 3):