Python: skip interpreting empty paragraphs

This commit is contained in:
Alexander Bezzubov 2016-06-22 17:49:23 +09:00
parent a7248cdc94
commit bc91b86f94

View file

@ -134,7 +134,9 @@ public class PythonInterpreter extends Interpreter {
@Override
public InterpreterResult interpret(String cmd, InterpreterContext contextInterpreter) {
this.context = contextInterpreter;
if (cmd == null || cmd.isEmpty()) {
return new InterpreterResult(Code.SUCCESS, "");
}
String output = sendCommandToPython(cmd);
return new InterpreterResult(Code.SUCCESS, output.replaceAll(">>>", "")
.replaceAll("\\.\\.\\.", "").trim());