Skip to content

Commit 211a97c

Browse files
committed
No need to change this.
1 parent c6bf9f9 commit 211a97c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/libyt_python_shell.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,10 +471,8 @@ CodeValidity LibytPythonShell::check_code_validity(const std::string& code, bool
471471

472472
// clear error buffer before redirecting stderr
473473
PyErr_Clear();
474-
PyRun_SimpleString("import sys, io");
475-
PyRun_SimpleString("sys.OUTPUT_STDERR=''");
476-
PyRun_SimpleString("stderr_buf=io.StringIO()");
477-
PyRun_SimpleString("sys.stderr=stderr_buf");
474+
PyRun_SimpleString("import sys, io\n");
475+
PyRun_SimpleString("sys.OUTPUT_STDERR=''\nstderr_buf=io.StringIO()\nsys.stderr=stderr_buf\n");
478476

479477
PyObject* py_test_compile;
480478
if (prompt_env) {

0 commit comments

Comments
 (0)