--- a/UI/UserInterface.py Wed Aug 09 17:12:14 2017 +0200 +++ b/UI/UserInterface.py Thu Aug 10 11:57:04 2017 +0200 @@ -6507,39 +6507,33 @@ """ url = "" try: - if "-snapshot-" in VersionOnly: - # check snapshot version - if versions[2][0] == "6" and versions[2] > VersionOnly: - res = E5MessageBox.yesNo( - self, - self.tr("Update available"), - self.tr( - """The update to <b>{0}</b> of eric6 is""" - """ available at <b>{1}</b>. Would you like to""" - """ get it?""") - .format(versions[2], versions[3]), - yesDefault=True) - url = res and versions[3] or '' - elif versions[0] > VersionOnly: - res = E5MessageBox.yesNo( - self, - self.tr("Update available"), - self.tr( - """The update to <b>{0}</b> of eric6 is""" - """ available at <b>{1}</b>. Would you like to""" - """ get it?""") - .format(versions[0], versions[1]), - yesDefault=True) - url = res and versions[1] or '' + if "snapshot-" in VersionOnly: + # check snapshot version like snapshot-20170810 + if "snapshot-" in versions[2]: + installedSnapshotDate = VersionOnly.rsplit("-", 1)[-1] + availableSnapshotDate = versions[2].rsplit("-", 1)[-1] + if availableSnapshotDate > installedSnapshotDate: + res = E5MessageBox.yesNo( + self, + self.tr("Update available"), + self.tr( + """The update to <b>{0}</b> of eric6 is""" + """ available at <b>{1}</b>. Would you like""" + """ to get it?""") + .format(versions[2], versions[3]), + yesDefault=True) + url = res and versions[3] or '' else: if self.manualUpdatesCheck: E5MessageBox.information( self, - self.tr("Eric6 is up to date"), + self.tr("Update Check"), self.tr( - """You are using the latest version of""" - """ eric6""")) + """You are using a snapshot release of""" + """ eric6. A more up-to-date stable release""" + """ might be available.""")) elif VersionOnly.startswith(("rev_", "@@")): + # check installation from source if self.manualUpdatesCheck: E5MessageBox.information( self, @@ -6571,7 +6565,7 @@ self.tr( """You are using the latest version of""" """ eric6""")) - except IndexError: + except (IndexError, TypeError): E5MessageBox.warning( self, self.tr("Error during updates check"), @@ -6706,7 +6700,7 @@ @param version version string @type str @return version tuple - @rtype tuple of int and str + @rtype tuple of int """ versionParts = [] for part in version.split("."): @@ -6715,8 +6709,8 @@ try: part = int(part) except ValueError: - # not an integer - pass + # not an integer, ignore + continue versionParts.append(part) return tuple(versionParts)