diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2015-05-03 12:39:16 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-05-03 12:39:16 -0400 |
| commit | 0cc8362038f6feb3ede00ee9ce8ba8c7d04940d9 (patch) | |
| tree | fe489fb6cb4ebd3e2e52df136eb276147b58ab5f | |
| parent | e55483f33a61c302461ed480a3556d746b8aba40 (diff) | |
| download | python-setuptools-git-0cc8362038f6feb3ede00ee9ce8ba8c7d04940d9.tar.gz | |
Use new string formatting
| -rw-r--r-- | setuptools/dist.py | 15 |
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""" |
