Commit f67c1b09 authored by Jason R. Coombs's avatar Jason R. Coombs

Extract method for maybe_tag.

parent 1ea521c5
...@@ -123,12 +123,17 @@ class InfoCommon: ...@@ -123,12 +123,17 @@ class InfoCommon:
return safe_name(self.distribution.get_name()) return safe_name(self.distribution.get_name())
def tagged_version(self): def tagged_version(self):
version = self.distribution.get_version() return safe_version(self._maybe_tag(self.distribution.get_version()))
# egg_info may be called more than once for a distribution,
# in which case the version string already contains all tags. def _maybe_tag(self, version):
if self.vtags and version.endswith(self.vtags): """
return safe_version(version) egg_info may be called more than once for a distribution,
return safe_version(version + self.vtags) in which case the version string already contains all tags.
"""
return (
version if self.vtags and version.endswith(self.vtags)
else version + self.vtags
)
def tags(self): def tags(self):
version = '' version = ''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment