diff options
| author | 2018-10-12 12:46:05 +0100 | |
|---|---|---|
| committer | 2018-10-12 12:46:05 +0100 | |
| commit | 4700402db46a75c5024563fabca32f5f097690e1 (patch) | |
| tree | 1d8587898a38c274687e95ffe0961ead46b589de | |
| parent | Support 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
| -rw-r--r-- | modules/eval_python.py | 3 |
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) |
