diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-02-16 02:13:45 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-02-16 02:13:45 -0500 |
commit | b5cd47fbd96ae900dd835b68484084ab1219f260 (patch) | |
tree | 1fac3914b18177434274b291e72c61a6b0595ba3 /pkg_resources.py | |
parent | 5f738c54a3de45e1f44321eb8e27cfe10ce97e90 (diff) | |
download | external_python_setuptools-b5cd47fbd96ae900dd835b68484084ab1219f260.tar.gz external_python_setuptools-b5cd47fbd96ae900dd835b68484084ab1219f260.tar.bz2 external_python_setuptools-b5cd47fbd96ae900dd835b68484084ab1219f260.zip |
Backed out changeset: d0a8d1a83053
In the discussion in #278, it became clear that the deviance in behavior from setuptools is problemmatic. For compatibility, defer to the setuptools version scheme as specifically intended.
--HG--
branch : distribute
extra : rebase_source : 1d5cc8c216f974b247e2dc84d8d40c868d6d3639
Diffstat (limited to 'pkg_resources.py')
-rw-r--r-- | pkg_resources.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index 49aab675..69601480 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -1936,7 +1936,7 @@ replace = {'pre':'c', 'preview':'c','-':'final-','rc':'c','dev':'@'}.get def _parse_version_parts(s): for part in component_re.split(s): part = replace(part,part) - if part in ['', '.']: + if not part or part=='.': continue if part[:1] in '0123456789': yield part.zfill(8) # pad for numeric comparison @@ -1979,6 +1979,8 @@ def parse_version(s): parts = [] for part in _parse_version_parts(s.lower()): if part.startswith('*'): + if part<'*final': # remove '-' before a prerelease tag + while parts and parts[-1]=='*final-': parts.pop() # remove trailing zeros from each series of numeric parts while parts and parts[-1]=='00000000': parts.pop() |