From df3e01900e5a86d3c0d489336a820b5b1cc3c1e1 Mon Sep 17 00:00:00 2001 From: Paillat Date: Tue, 15 Aug 2023 18:50:25 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(functionscalls.py):=20reform?= =?UTF-8?q?at=20code=20for=20better=20readability=20and=20maintainability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/functionscalls.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/functionscalls.py b/src/functionscalls.py index aefa360..2d94261 100644 --- a/src/functionscalls.py +++ b/src/functionscalls.py @@ -323,7 +323,9 @@ async def evaluate_math( raise FuntionCallError("No string provided") loop = asyncio.get_event_loop() try: - result = await asyncio.wait_for(loop.run_in_executor(None, simple_eval, evaluable), timeout=timeout) + result = await asyncio.wait_for( + loop.run_in_executor(None, simple_eval, evaluable), timeout=timeout + ) except Exception as e: result = f"Error: {e}" return f"Result to math eval of {evaluable}: ```\n{str(result)}```"