aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Mohammad Ibrahim <[email protected]>2023-03-03 01:53:55 +0530
committerGravatar Ibrahim <[email protected]>2023-03-03 01:56:31 +0530
commitf0119faacfd9db6f972a56d74e327a00a2e29a48 (patch)
treed345ef432108b2b58edcbc50002c7d8c30fb01b8
parentAdd warning message when using `input` (diff)
Wookie's review
+ Double quotes for consistency + Using results["stdout"] instead of output so the warning is still displayed if the error doesn't fit in the message. + Using endswith so we don't need to hardcode the constant. Co-authored-by: wookie184 <[email protected]>
-rw-r--r--bot/exts/utils/snekbox.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/exts/utils/snekbox.py b/bot/exts/utils/snekbox.py
index 7ee5c5d21..1c0896804 100644
--- a/bot/exts/utils/snekbox.py
+++ b/bot/exts/utils/snekbox.py
@@ -347,7 +347,7 @@ class Snekbox(Cog):
warning_message = ""
# 33 is the length of the error message. It is done to make sure the last line of output contains
# the error and the error is not manually printed by the author with a syntax error.
- if "EOFError: EOF when reading a line" in output[-33:] and results['returncode'] == 1:
+ if results["stdout"].rstrip().endswith("EOFError: EOF when reading a line") and results["returncode"] == 1:
warning_message += ":warning: Note: `input` is not supported by the bot :warning:\n\n"
icon = self.get_status_emoji(results)