summaryrefslogtreecommitdiff
path: root/pkg_resources.py
diff options
context:
space:
mode:
authorguyroz <none@none>2011-09-17 16:20:05 +0300
committerguyroz <none@none>2011-09-17 16:20:05 +0300
commitc0032c0de589c7f8f633314cae891bbb2191dbce (patch)
treec89caedaf751a6505362843460d418f850fab271 /pkg_resources.py
parent4593c7e5cdc0e467a1c1957a0c864db804c4147a (diff)
downloadpython-setuptools-git-c0032c0de589c7f8f633314cae891bbb2191dbce.tar.gz
Issue #208: fixing parse_version and post-release tags
including tests --HG-- branch : distribute extra : rebase_source : f953ba35614c338161249d6d74c7cda08acdf32b
Diffstat (limited to 'pkg_resources.py')
-rw-r--r--pkg_resources.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/pkg_resources.py b/pkg_resources.py
index 52d92669..e8dae8a4 100644
--- a/pkg_resources.py
+++ b/pkg_resources.py
@@ -1912,7 +1912,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 not part or part=='.':
+ if part in ['', '.']:
continue
if part[:1] in '0123456789':
yield part.zfill(8) # pad for numeric comparison
@@ -1955,8 +1955,6 @@ 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()