Skip to content

Commit e938a96

Browse files
Clarify error message when no target Python version is specified (#5006)
Co-authored-by: cobalt <61329810+cobaltt7@users.noreply.github.com>
1 parent 361f6a3 commit e938a96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/black/mode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class Feature(Enum):
214214

215215
def supports_feature(target_versions: set[TargetVersion], feature: Feature) -> bool:
216216
if not target_versions:
217-
raise ValueError("target_versions must not be empty")
217+
raise ValueError("At least one target Python version must be specified.")
218218

219219
return all(feature in VERSION_TO_FEATURES[version] for version in target_versions)
220220

0 commit comments

Comments
 (0)