[4suite-checkins] [XML1_0-maint] In 4Suite/Ft/Lib/DistExt, files Version.py

Jeremy Kloth jkloth at 4suite.org
Wed Nov 19 03:05:22 MST 2008


Branch: XML1_0-maint

Modified Files:
    Version.py

Log Message:
Fixed infinite recursion error when dealing with "bad" version strings

ViewCVS diff:
  http://cvs.4suite.org/viewcvs/4Suite/Ft/Lib/DistExt/Version.py.diff?r1=1.1.2.1&r2=1.1.2.2
ViewCVS view:
  http://cvs.4suite.org/viewcvs/4Suite/Ft/Lib/DistExt/Version.py?rev=1.1.2.2&content-type=text/vnd.viewcvs-markup

Index: Version.py
===================================================================
RCS file: /var/local/cvsroot/4Suite/Ft/Lib/DistExt/Version.py,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -U 2 -r1.1.2.1 -r1.1.2.2
--- Version.py	9 Oct 2006 00:48:29 -0000	1.1.2.1
+++ Version.py	19 Nov 2008 10:05:21 -0000	1.1.2.2
@@ -67,13 +67,21 @@
                 raise ValueError("invalid release tag: %r" % vstring[start:])
             tag, version = match.groups()
-            tag = tag and tag.lower()
-            if tag in self.tag_aliases:
-                tag = self.tag_aliases[tag]
+            if tag:
+                tag = tag.lower()
+                if tag in self.tag_aliases:
+                    tag = self.tag_aliases[tag]
+            else:
+                tag = None
             if version:
                 version = versiontuple(version)
             else:
                 version = None
+            if not (tag or version):
+                # Nothing matched, use the remainder as the tag
+                tag = vstring[start:]
+                start = end
+            else:
+                start = match.end()
             tags.append((tag, version))
-            start = match.end()
         self.tags = tuple(tags)
         return


More information about the 4suite-checkins mailing list