mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 01:06:19 +00:00
🐛 fix(functionscalls.py): reformat code for better readability and maintainability
This commit is contained in:
@@ -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)}```"
|
||||||
|
|||||||
Reference in New Issue
Block a user