🐛 fix(functionscalls.py): reformat code for better readability and maintainability

This commit is contained in:
2023-08-15 18:50:25 +02:00
parent 30ef28ce49
commit df3e01900e

View File

@@ -323,7 +323,9 @@ async def evaluate_math(
raise FuntionCallError("No string provided") raise FuntionCallError("No string provided")
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
try: 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: except Exception as e:
result = f"Error: {e}" result = f"Error: {e}"
return f"Result to math eval of {evaluable}: ```\n{str(result)}```" return f"Result to math eval of {evaluable}: ```\n{str(result)}```"