[Python-checkins] release: normalize the version to always have patch level

benjamin.peterson python-checkins at python.org
Fri Jul 8 20:34:31 CEST 2011


http://hg.python.org/release/rev/ccd9861ad360
changeset:   58:ccd9861ad360
user:        Benjamin Peterson <benjamin at python.org>
date:        Fri Jul 08 13:38:52 2011 -0500
summary:
  normalize the version to always have patch level

files:
  release.py |  7 +++++--
  1 files changed, 5 insertions(+), 2 deletions(-)


diff --git a/release.py b/release.py
--- a/release.py
+++ b/release.py
@@ -344,13 +344,16 @@
         for i, thing in enumerate(data):
             if thing is None:
                 data[i] = 0
-        self.text = tag_name
-        self.next_text = tag_name
         self.major = int(data[0])
         self.minor = int(data[1])
         self.patch = int(data[2])
         self.level = data[3]
         self.serial = int(data[4])
+        # This has the effect of normalizing the version.
+        self.text = "{}.{}.{}".format(self.major, self.minor, self.patch)
+        if self.level != "f":
+            self.text += self.level + str(self.serial)
+        self.next_text = tag_name
         self.basic_version = '%s.%s' % (self.major, self.minor)
 
     def __str__(self):

-- 
Repository URL: http://hg.python.org/release


More information about the Python-checkins mailing list