Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
fixing versionToTuple
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Groszer committed Jun 15, 2010
1 parent 139c6ef commit a4bbbd1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/zope/wineggbuilder/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,16 @@ def build(self, package, version, files, sourceFolder):
#continue without bailing out

def versionToTuple(version):
parts = version.split('.')
parts = [int(v) for v in parts]
#tries to do "3.4.0" -> ('0003','0004','0000')
#otherwise the problem starts with 3.10.0, that would be less than 3.4.0
#problems arise on the last digit when it has 'dev' or 'b'
parts = []
for p in version.split('.'):
try:
# we try our best to convert to a comparable number
parts.append("%04d" % int(v))
except ValueError:
parts.append(v)
return tuple(parts)

class Package(object):
Expand Down

0 comments on commit a4bbbd1

Please sign in to comment.