summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-03-20 15:38:04 -0400
committerJason R. Coombs <jaraco@jaraco.com>2015-03-20 15:38:04 -0400
commitfd3aab2c34a01a9915b77e05c34b806c7a547097 (patch)
treef0a058ef5554d21a955645737658d6d05c1c8396
parent0a94bcea1d57e7537cba12992f35ac45f6eb8407 (diff)
downloadpython-setuptools-bitbucket-fd3aab2c34a01a9915b77e05c34b806c7a547097.tar.gz
Prefer new string formatting. Re-use variable names.
-rw-r--r--pkg_resources/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index f7611472..607d0eec 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -2521,14 +2521,15 @@ class Distribution(object):
return
tmpl = textwrap.dedent("""
- '%s (%s)' is being parsed as a legacy, non PEP 440,
+ '{project_name} ({version})' is being parsed as a legacy,
+ non PEP 440,
version. You may find odd behavior and sort order.
In particular it will be sorted as less than 0.0. It
is recommend to migrate to PEP 440 compatible
versions.
""").strip().replace('\n', ' ')
- warnings.warn(tmpl % (self.project_name, self.version), PEP440Warning)
+ warnings.warn(tmpl.format(**vars(self)), PEP440Warning)
@property
def version(self):