summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author?ric Araujo <merwok@netwok.org>2011-10-05 01:08:51 +0200
committer?ric Araujo <merwok@netwok.org>2011-10-05 01:08:51 +0200
commit4ae9f13581e67df33042952cedd023e3b3dded8c (patch)
treedfb641b406378d133f5555869c17d6697cd43425
parent70e24f0cc1081fe452f9b26613e1dbbb5eb3cf9e (diff)
downloaddisutils2-4ae9f13581e67df33042952cedd023e3b3dded8c.tar.gz
Cosmetic fixes for whitespace and a regex.
The goal of the regex is to catch a (alpha), b (beta), c or rc (release candidate), so the existing pattern puzzled me. Tests were OK before and after the change.
-rw-r--r--distutils2/tests/test_version.py8
-rw-r--r--distutils2/version.py2
2 files changed, 5 insertions, 5 deletions
diff --git a/distutils2/tests/test_version.py b/distutils2/tests/test_version.py
index 38db157..1928bbd 100644
--- a/distutils2/tests/test_version.py
+++ b/distutils2/tests/test_version.py
@@ -103,7 +103,7 @@ class VersionTestCase(unittest.TestCase):
False
>>> V('1.2.0rc1') >= V('1.2.0')
False
- >>> (V('1.0') > V('1.0b2'))
+ >>> V('1.0') > V('1.0b2')
True
>>> V('1.0') > V('1.0c2')
True
@@ -248,9 +248,9 @@ class VersionWhiteBoxTestCase(unittest.TestCase):
def test_parse_numdots(self):
# For code coverage completeness, as pad_zeros_length can't be set or
# influenced from the public interface
- self.assertEqual(V('1.0')._parse_numdots('1.0', '1.0',
- pad_zeros_length=3),
- [1, 0, 0])
+ self.assertEqual(
+ V('1.0')._parse_numdots('1.0', '1.0', pad_zeros_length=3),
+ [1, 0, 0])
def test_suite():
diff --git a/distutils2/version.py b/distutils2/version.py
index 9e4a7dc..4eedb0b 100644
--- a/distutils2/version.py
+++ b/distutils2/version.py
@@ -253,7 +253,7 @@ def suggest_normalized_version(s):
# if we have something like "b-2" or "a.2" at the end of the
# version, that is pobably beta, alpha, etc
# let's remove the dash or dot
- rs = re.sub(r"([abc|rc])[\-\.](\d+)$", r"\1\2", rs)
+ rs = re.sub(r"([abc]|rc)[\-\.](\d+)$", r"\1\2", rs)
# 1.0-dev-r371 -> 1.0.dev371
# 0.1-dev-r79 -> 0.1.dev79