Skip to content

Commit c43f765

Browse files
committed
Fix: Create 'TextIOWrapper' even in case of unbuffered IO.
1 parent ac0bfd1 commit c43f765

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

graalpython/lib-graalpython/__builtins_patches__.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,12 @@ def open(*args, **kwargs):
8080
sys.stdin = _pyio.TextIOWrapper(_pyio.BufferedReader(sys.stdin), encoding="utf-8", line_buffering=True)
8181
sys.stdin.mode = "r"
8282
sys.__stdin__ = sys.stdin
83-
if not sys.graal_python_unbuffered_io:
84-
sys.stdout = _pyio.TextIOWrapper(_pyio.BufferedWriter(sys.stdout), encoding="utf-8", line_buffering=True)
85-
sys.stdout.mode = "w"
86-
sys.__stdout__ = sys.stdout
87-
sys.stderr = _pyio.TextIOWrapper(_pyio.BufferedWriter(sys.stderr), encoding="utf-8", line_buffering=True)
88-
sys.stderr.mode = "w"
89-
sys.__stderr__ = sys.stderr
83+
sys.stdout = _pyio.TextIOWrapper(_pyio.BufferedWriter(sys.stdout), encoding="utf-8", line_buffering=True)
84+
sys.stdout.mode = "w"
85+
sys.__stdout__ = sys.stdout
86+
sys.stderr = _pyio.TextIOWrapper(_pyio.BufferedWriter(sys.stderr), encoding="utf-8", line_buffering=True)
87+
sys.stderr.mode = "w"
88+
sys.__stderr__ = sys.stderr
9089

9190

9291
# ----------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)