diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2015-03-20 15:38:04 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-03-20 15:38:04 -0400 |
| commit | 80c6b750898c53a0f627c64a0b953ae0e5fdb9d7 (patch) | |
| tree | 41581a41dbd52abb2884400fa3ae25cc639ed339 /pkg_resources/__init__.py | |
| parent | acd20ca332bb3f0ad48c7d92f832bfb2121decc1 (diff) | |
| download | python-setuptools-git-80c6b750898c53a0f627c64a0b953ae0e5fdb9d7.tar.gz | |
Prefer new string formatting. Re-use variable names.
Diffstat (limited to 'pkg_resources/__init__.py')
| -rw-r--r-- | pkg_resources/__init__.py | 5 |
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): |
