diff options
| author | 2019-12-25 18:20:16 +0100 | |
|---|---|---|
| committer | 2019-12-25 18:20:16 +0100 | |
| commit | ab0d44b8e013694c2e92af51c6fdb8ed9239c331 (patch) | |
| tree | be49707f4ef6f1cdf71dd6ba7c278584ade0a9f5 | |
| parent | Merge pull request #655 from kwzrd/unittest-mentions (diff) | |
Hardcode SIGKILL value
It allows the cog to also work on Windows, because of Signals.SIGKILL not being defined on this platform
| -rw-r--r-- | bot/cogs/snekbox.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/cogs/snekbox.py b/bot/cogs/snekbox.py index da33e27b2..e9e5465ad 100644 --- a/bot/cogs/snekbox.py +++ b/bot/cogs/snekbox.py @@ -36,6 +36,8 @@ RAW_CODE_REGEX = re.compile( MAX_PASTE_LEN = 1000 EVAL_ROLES = (Roles.helpers, Roles.moderator, Roles.admin, Roles.owner, Roles.rockstars, Roles.partners) +SIGKILL = 9 + class Snekbox(Cog): """Safe evaluation of Python code using Snekbox.""" @@ -101,7 +103,7 @@ class Snekbox(Cog): if returncode is None: msg = "Your eval job has failed" error = stdout.strip() - elif returncode == 128 + Signals.SIGKILL: + elif returncode == 128 + SIGKILL: msg = "Your eval job timed out or ran out of memory" elif returncode == 255: msg = "Your eval job has failed" |