@@ -140,8 +140,7 @@ def _check_marker(marker):
140
140
def assert_bool (dist , attr , value ):
141
141
"""Verify that value is True, False, 0, or 1"""
142
142
if bool (value ) != value :
143
- tmpl = "{attr!r} must be a boolean value (got {value!r})"
144
- raise DistutilsSetupError (tmpl .format (attr = attr , value = value ))
143
+ raise DistutilsSetupError (f"{ attr !r} must be a boolean value (got { value !r} )" )
145
144
146
145
147
146
def invalid_unless_false (dist , attr , value ):
@@ -163,20 +162,20 @@ def check_requirements(dist, attr: str, value: _StrOrIter) -> None:
163
162
if isinstance (value , (dict , set )):
164
163
raise TypeError ("Unordered types are not allowed" )
165
164
except (TypeError , ValueError ) as error :
166
- tmpl = (
165
+ msg = (
167
166
f"{ attr !r} must be a string or iterable of strings "
168
167
f"containing valid project/version requirement specifiers; { error } "
169
168
)
170
- raise DistutilsSetupError (tmpl ) from error
169
+ raise DistutilsSetupError (msg ) from error
171
170
172
171
173
172
def check_specifier (dist , attr , value ):
174
173
"""Verify that value is a valid version specifier"""
175
174
try :
176
175
SpecifierSet (value )
177
176
except (InvalidSpecifier , AttributeError ) as error :
178
- tmpl = "{attr!r} must be a string containing valid version specifiers; {error}"
179
- raise DistutilsSetupError (tmpl . format ( attr = attr , error = error ) ) from error
177
+ msg = f "{ attr !r} must be a string containing valid version specifiers; { error } "
178
+ raise DistutilsSetupError (msg ) from error
180
179
181
180
182
181
def check_entry_points (dist , attr , value ):
0 commit comments