Skip to content

Commit 938f148

Browse files
committed
Ensure append mode works properly for stdout
1 parent bddd908 commit 938f148

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/xopen/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ def flush(self) -> None:
433433

434434
def _open_stdin_or_out(mode: str) -> BinaryIO:
435435
assert "b" in mode
436-
std = sys.stdout if "w" in mode else sys.stdin
436+
std = sys.stdin if mode == "rb" else sys.stdout
437437
return open(std.fileno(), mode=mode, closefd=False) # type: ignore
438438

439439

0 commit comments

Comments
 (0)