This commit is contained in:
Saifeddine ALOUI 2024-04-10 09:19:37 +02:00
parent b9a93a2d1b
commit d981ee5867

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}