Commits

Vinay Sajip committed 4069e1e

Updated legacy pre-release handling to be the same as that of setuptools.

  • Participants
  • Parent commits 606b556

Comments (0)

Files changed (2)

File distlib/version.py

     def parse(self, s):
         return _legacy_key(s)
 
-    PREREL_TAGS = set(
-        ['*a', '*alpha', '*b', '*beta', '*c', '*rc', '*r', '*@', '*pre']
-    )
-
     @property
     def is_prerelease(self):
-        return any(x in self.PREREL_TAGS for x in self._parts)
+        result = False
+        for x in self._parts:
+            if (isinstance(x, string_types) and x.startswith('*') and
+                x < '*final'):
+                result = True
+                break
+        return result
 
 
 class LegacyMatcher(Matcher):

File tests/test_version.py

             '1.0rc1',
             'A56',
             '1.0b',
+            '0.79.9999+0.80.0'
         )
         final_releases = (
             '0.80.1-3',
             '2.1.0',
             '3.2pl1-1',
-            '0.79.9999+0.80.0'
         )
         for s in pre_releases:
             self.assertTrue(LV(s).is_prerelease, s)