From ab7e035f6e7fea0fcf5ef8c64f72d1603c34bf84 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 3 Feb 2017 11:26:44 +0100 Subject: [PATCH] Don't continue with compiling when function has error This would give an exception which breaks the script and makes a very unclear chained error message. Contributes to issue CURA-2572. --- tests/runtest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/runtest.py b/tests/runtest.py index cacc21a8..f46676cb 100644 --- a/tests/runtest.py +++ b/tests/runtest.py @@ -236,10 +236,13 @@ class Setting: compiled = compile(code, self._key, "eval") except (SyntaxError, TypeError) as e: print("Parse error in function (" + str(code) + ") for setting", self._key + ":", str(e)) + return None except IllegalMethodError as e: print("Use of illegal method", str(e), "in function (" + code + ") for setting", self._key) + return None except Exception as e: print("Exception in function (" + code + ") for setting", self._key + ":", str(e)) + return None return eval(compiled, globals(), locals)