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
commit80c6b750898c53a0f627c64a0b953ae0e5fdb9d7 (patch)
tree41581a41dbd52abb2884400fa3ae25cc639ed339
parentacd20ca332bb3f0ad48c7d92f832bfb2121decc1 (diff)
downloadpython-setuptools-git-80c6b750898c53a0f627c64a0b953ae0e5fdb9d7.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):