summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author?ric Araujo <merwok@netwok.org>2012-10-27 11:58:05 -0400
committer?ric Araujo <merwok@netwok.org>2012-10-27 11:58:05 -0400
commit3bd2eeda2384239d49606b8dbbcc50d9aea74c02 (patch)
treec353cc9a9a1bd08e3ce5245837869f03e3df4248
parent273927821682f7abba2c961671e26d3274bb9b02 (diff)
downloaddisutils2-3bd2eeda2384239d49606b8dbbcc50d9aea74c02.tar.gz
Fix stringification of final versions (#16107).
Report and patch by Richard Jones.
-rw-r--r--CHANGES.txt1
-rw-r--r--CONTRIBUTORS.txt1
-rw-r--r--distutils2/tests/test_version.py4
-rw-r--r--distutils2/version.py3
4 files changed, 8 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 2a00895..27409cf 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -21,6 +21,7 @@ CONTRIBUTORS.txt for full names. Bug numbers refer to http://bugs.python.org/.
- #10374: Recreate scripts everytime build_scripts is called [pierre paul]
- #14733: Have pysetup read setup.cfg early enough to find custom commands
[éric, janusz]
+- #16107: Fix trailing '.z' in str('1.0.post1') result [richard]
1.0a4 - 2012-03-13
------------------
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index 8f8e059..40bd735 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -42,6 +42,7 @@ Thanks to:
- Preston Holmes
- Christian Hudon
- Julien Jehannet
+- Richard Jones
- Jeremy Kloth
- Amos Latteier
- Mathieu Leduc-Hamel
diff --git a/distutils2/tests/test_version.py b/distutils2/tests/test_version.py
index d2d43ce..849ad5a 100644
--- a/distutils2/tests/test_version.py
+++ b/distutils2/tests/test_version.py
@@ -21,7 +21,9 @@ class VersionTestCase(unittest.TestCase):
(V('1.2.3.4.0b3', drop_trailing_zeros=True), '1.2.3.4b3'),
(V('1.2.0.0.0', drop_trailing_zeros=True), '1.2'),
(V('1.0.dev345'), '1.0.dev345'),
- (V('1.0.post456.dev623'), '1.0.post456.dev623'))
+ (V('1.0.post456.dev623'), '1.0.post456.dev623'),
+ (V('1.0.post1'), '1.0.post1'),
+ )
def test_repr(self):
diff --git a/distutils2/version.py b/distutils2/version.py
index 7f49a2e..3bd0fb1 100644
--- a/distutils2/version.py
+++ b/distutils2/version.py
@@ -174,6 +174,9 @@ class NormalizedVersion(object):
if postdev and postdev is not _FINAL_MARKER:
if postdev[0] == _FINAL_MARKER[0]:
postdev = postdev[1:]
+ # remove trailing '.z'
+ if postdev[-1] == _FINAL_MARKER[0]:
+ postdev = postdev[:-1]
i = 0
while i < len(postdev):
if i % 2 == 0: