Skip to content

Commit

Permalink
use invoke to redirect streams instead of exec
Browse files Browse the repository at this point in the history
  • Loading branch information
ndjensen committed Aug 1, 2021
1 parent a4716db commit 4cd93b8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/java/jep/Jep.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,10 @@ protected void configureInterpreter(JepConfig config) throws JepException {
if (config.redirectStdout != null || config.redirectStderr != null) {
exec("from jep import redirect_streams");
if (config.redirectStdout != null) {
set("stdoutOutputStream", config.redirectStdout);
exec("redirect_streams.redirectStdout(stdoutOutputStream)");
invoke("redirect_streams.redirectStdout", config.redirectStdout);
}
if (config.redirectStderr != null) {
set("stderrOutputStream", config.redirectStderr);
exec("redirect_streams.redirectStderr(stderrOutputStream)");
invoke("redirect_streams.redirectStderr", config.redirectStderr);
}
}
}
Expand Down

0 comments on commit 4cd93b8

Please sign in to comment.