summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setuptools/dist.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py
index 05669366..d7ad4655 100644
--- a/setuptools/dist.py
+++ b/setuptools/dist.py
@@ -115,19 +115,20 @@ def check_extras(dist, attr, value):
def assert_bool(dist, attr, value):
"""Verify that value is True, False, 0, or 1"""
if bool(value) != value:
- raise DistutilsSetupError(
- "%r must be a boolean value (got %r)" % (attr,value)
- )
+ tmpl = "{attr!r} must be a boolean value (got {value!r})"
+ raise DistutilsSetupError(tmpl.format(attr=attr, value=value))
+
+
def check_requirements(dist, attr, value):
"""Verify that install_requires is a valid requirements list"""
try:
list(pkg_resources.parse_requirements(value))
- except (TypeError, ValueError) as e:
+ except (TypeError, ValueError) as error:
tmpl = (
- "%r must be a string or list of strings "
- "containing valid project/version requirement specifiers; %s"
+ "{attr!r} must be a string or list of strings "
+ "containing valid project/version requirement specifiers; {error}"
)
- raise DistutilsSetupError(tmpl % (attr, e))
+ raise DistutilsSetupError(tmpl.format(attr=attr, error=error))
def check_entry_points(dist, attr, value):
"""Verify that entry_points map is parseable"""