aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-07-17 13:03:50 +0100
committerGravatar Chris Lovering <[email protected]>2022-07-21 13:03:22 +0100
commit41482168dbfef410e1b37f6845b5dc8bd6c45775 (patch)
treeb393a96aea446c680e6bb7524828c91d49e7905c
parentUse the view clear on timeout feature from bot-core in snekbox (diff)
Include what version of Python was used in snekbox output.
-rw-r--r--bot/exts/utils/snekbox.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/bot/exts/utils/snekbox.py b/bot/exts/utils/snekbox.py
index 7c9f9843a..8e961b67c 100644
--- a/bot/exts/utils/snekbox.py
+++ b/bot/exts/utils/snekbox.py
@@ -233,19 +233,19 @@ class Snekbox(Cog):
return code, args
@staticmethod
- def get_results_message(results: dict, job_name: str) -> Tuple[str, str]:
+ def get_results_message(results: dict, job_name: str, python_version: Literal["3.10", "3.11"]) -> Tuple[str, str]:
"""Return a user-friendly message and error corresponding to the process's return code."""
stdout, returncode = results["stdout"], results["returncode"]
- msg = f"Your {job_name} job has completed with return code {returncode}"
+ msg = f"Your {python_version} {job_name} job has completed with return code {returncode}"
error = ""
if returncode is None:
- msg = f"Your {job_name} job has failed"
+ msg = f"Your {python_version} {job_name} job has failed"
error = stdout.strip()
elif returncode == 128 + SIGKILL:
- msg = f"Your {job_name} job timed out or ran out of memory"
+ msg = f"Your {python_version} {job_name} job timed out or ran out of memory"
elif returncode == 255:
- msg = f"Your {job_name} job has failed"
+ msg = f"Your {python_version} {job_name} job has failed"
error = "A fatal NsJail error occurred"
else:
# Try to append signal's name if one exists
@@ -330,7 +330,7 @@ class Snekbox(Cog):
"""
async with ctx.typing():
results = await self.post_job(code, python_version, args=args)
- msg, error = self.get_results_message(results, job_name)
+ msg, error = self.get_results_message(results, job_name, python_version)
if error:
output, paste_link = error, None