aboutsummaryrefslogtreecommitdiff
path: root/modules/eval_python.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-12 12:46:05 +0100
committerGravatar jesopo2018-10-12 12:46:05 +0100
commit4700402db46a75c5024563fabca32f5f097690e1 (patch)
tree1d8587898a38c274687e95ffe0961ead46b589de /modules/eval_python.py
parentSupport py2 and py3 in eval_python (diff)
signature
Add a \n between potential prints in eval() and printing the return from eval so
that bitbot will only show one of them
Diffstat (limited to 'modules/eval_python.py')
-rw-r--r--modules/eval_python.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/eval_python.py b/modules/eval_python.py
index e762a167..bf5cd5ec 100644
--- a/modules/eval_python.py
+++ b/modules/eval_python.py
@@ -4,6 +4,7 @@ from src import ModuleManager, utils
EVAL_TEMPLATE = """
import sys
result = eval(sys.stdin.read())
+print("")
if not result == None:
sys.stdout.write(str(result))
"""
@@ -28,7 +29,7 @@ class Module(ModuleManager.BaseModule):
if page:
event["stdout"].write("%s: %s" % (event["user"].nickname,
- page.split("</b></span><br>", 1)[1]))
+ page.split("</b></span><br>", 1)[1].strip("\n")))
else:
event["stderr"].write("%s: failed to eval" % event["user"].nickname)