From 295ef2bfd75e142ff2cd59f2ec6975400649f981 Mon Sep 17 00:00:00 2001 From: fdai7763 Date: Tue, 23 Jan 2024 20:38:17 +0100 Subject: [PATCH] refactoring: simplified by removing unnecessary variable, added line at end of file --- src/main/py/read_math_function.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/py/read_math_function.py b/src/main/py/read_math_function.py index f2a2a7b..89ea18d 100644 --- a/src/main/py/read_math_function.py +++ b/src/main/py/read_math_function.py @@ -14,7 +14,6 @@ def is_allowed_string(type, value): def calculate_string(string): try: - result = eval(string) - return result + return eval(string) except Exception as e: - return f"Fehler bei der Berechnung: {str(e)}" \ No newline at end of file + return f"Fehler bei der Berechnung: {str(e)}"