From a5be90956561eb20562ecb9a51a6887ec061ab1e Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 14:56:59 +0000 Subject: [PATCH] refactor: autofix issues in 1 file Resolved issues in backend/auth.py with DeepSource Autofix --- backend/auth.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/auth.py b/backend/auth.py index fdf41afc..6fd5fc32 100644 --- a/backend/auth.py +++ b/backend/auth.py @@ -1,5 +1,10 @@ +import ast def sum(a, b): - assert a > 0 - assert b > 0 - return eval("a + b") + if not a > 0: + raise AssertionError + if not b > 0: + raise AssertionError + return ast.literal_eval("a + b") + raise AssertionError + return ast.literal_eval("a + b")