This commit is contained in:
Saifeddine ALOUI 2024-04-10 09:20:15 +02:00
parent d981ee5867
commit 20293c60c9

View File

@ -55,7 +55,7 @@ def execute_python(code, client:Client, message_id):
if process.returncode != 0:
# The child process threw an exception.
try:
error_message = f"Output:{output.decode('utf-8', errors='ignore')}\nError executing Python code:\n{error.decode('utf-8', errors="ignore")}"
error_message = f"Output:{output.decode('utf-8', errors='ignore')}\nError executing Python code:\n{error.decode('utf-8', errors='ignore')}"
except:
error_message = f"Error executing Python code:\n{error}"
error_json = {"output": "<div class='text-red-500'>"+error_message+"</div>", "execution_time": execution_time}