Skip to content

Commit 1002bc7

Browse files
committed
fix: catch any exception, not just InvalidVersion
Should also work with other exceptions that way, on older versions of OctoPrint. See #13
1 parent c00cc79 commit 1002bc7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

octoprint_firmware_check/checks/firmware_unsafe.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
from flask_babel import gettext
55
from octoprint.util.version import get_comparable_version
6-
from packaging.version import InvalidVersion
76

87
from . import AuthorCheck, Check, NegativeCapCheck, Severity
98

@@ -97,7 +96,7 @@ def _broken_version(self, line):
9796
version_str = line[len(self.VERSION) :]
9897
try:
9998
version = get_comparable_version(version_str, base=True)
100-
except InvalidVersion:
99+
except Exception:
101100
version = None
102101

103102
if version is not None and version < self.FIXED_VERSION:
@@ -168,7 +167,7 @@ class MalyanM200Check(Check):
168167
def m115(self, name, data):
169168
try:
170169
version = get_comparable_version(data.get("VER", "0"))
171-
except InvalidVersion:
170+
except Exception:
172171
version = None
173172

174173
self._triggered = (
@@ -237,7 +236,7 @@ def _extract_repetier_version(self, name):
237236
_, version = name.split("_", 1)
238237
try:
239238
version = get_comparable_version(version, base=True)
240-
except InvalidVersion:
239+
except Exception:
241240
pass
242241
return version
243242

0 commit comments

Comments
 (0)