X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/1d7260050d846d2ba2dd5bb22944b032245c7e51..117891878e5be4d6b771ae5de299e51b679cea27:/src/black/mode.py diff --git a/src/black/mode.py b/src/black/mode.py index b24c9c6..3c16756 100644 --- a/src/black/mode.py +++ b/src/black/mode.py @@ -6,6 +6,7 @@ chosen by the user. from dataclasses import dataclass, field from enum import Enum +from operator import attrgetter from typing import Dict, Set from black.const import DEFAULT_LINE_LENGTH @@ -134,7 +135,7 @@ class Mode: if self.target_versions: version_str = ",".join( str(version.value) - for version in sorted(self.target_versions, key=lambda v: v.value) + for version in sorted(self.target_versions, key=attrgetter("value")) ) else: version_str = "-"