Globals: added some error checking to 'versionToTuple'.

Sun, 23 Aug 2020 11:08:41 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 23 Aug 2020 11:08:41 +0200
changeset 7673
f0309b9483b1
parent 7672
8d3daf382286
child 7674
60fdbaf3508f

Globals: added some error checking to 'versionToTuple'.

eric6/Globals/__init__.py file | annotate | diff | comparison | revisions
--- a/eric6/Globals/__init__.py	Wed Aug 19 19:11:18 2020 +0200
+++ b/eric6/Globals/__init__.py	Sun Aug 23 11:08:41 2020 +0200
@@ -371,7 +371,11 @@
     # step 1: extract suffix
     version = re.split(r"[^\d.]", version)[0]
     for part in version.split("."):
-        versionParts.append(int(part))
+        try:
+            versionParts.append(int(part.strip()))
+        except ValueError:
+            # skip non-integer parts
+            pass
     versionParts.extend([0] * length)
     
     return tuple(versionParts[:length])

eric ide

mercurial