Fixed another issue in the versionIsNewer() method of UserInterface. maintenance

Sat, 21 Jan 2017 12:26:12 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 21 Jan 2017 12:26:12 +0100
branch
maintenance
changeset 5438
5971091376ef
parent 5434
26e03dfb240d
child 5440
d22ed5a4374f

Fixed another issue in the versionIsNewer() method of UserInterface.
(grafted from 272547f9afa0239cc8e982f60e584d3fbc88f33d)

UI/UserInterface.py file | annotate | diff | comparison | revisions
diff -r 26e03dfb240d -r 5971091376ef UI/UserInterface.py
--- a/UI/UserInterface.py	Fri Jan 20 18:46:09 2017 +0100
+++ b/UI/UserInterface.py	Sat Jan 21 12:26:12 2017 +0100
@@ -6648,18 +6648,23 @@
             # installed from cloned sources, always newer
             return True
         
-        if "-snapshot-" in VersionOnly:
+        if "snapshot-" in VersionOnly:
             # check snapshot version
             if snapshot is None:
                 return True
             else:
-                vers = VersionOnly.split("-snapshot-")[1]
+                vers = VersionOnly.split("snapshot-")[1]
                 return vers > snapshot
         
         versionTuple = self.__versionToTuple(VersionOnly)
         if isinstance(required, str):
             required = self.__versionToTuple(required)
-        return versionTuple > required
+        try:
+            res = versionTuple > required
+        except TypeError:
+            # some mismatching types, assume newer
+            res = True
+        return res
     
     def __versionToTuple(self, version):
         """

eric ide

mercurial