Put .strip("\n") call in the right place in modules/eval_python.py

This commit is contained in:
jesopo 2018-10-17 17:31:59 +01:00
parent c48574a3d6
commit dd93a84f80

View file

@ -41,12 +41,12 @@ class Module(ModuleManager.BaseModule):
pass pass
if page: if page:
out = page.split("</b></span><br>", 1)[1].strip("\n") out = page.split("</b></span><br>", 1)[1]
out = html.unescape(out) out = html.unescape(out)
out = json.loads(out) out = json.loads(out)
event["stdout" if out["success"] else "stderr"].write( event["stdout" if out["success"] else "stderr"].write(
"%s: %s" % (event["user"].nickname, out["out"])) "%s: %s" % (event["user"].nickname, out["out"].strip("\n")))
else: else:
event["stderr"].write("%s: failed to eval" % event["user"].nickname) event["stderr"].write("%s: failed to eval" % event["user"].nickname)