Skip to content

Commit 58104af

Browse files
committed
fixup! Use new builtin io.TextIOWrapper.reconfigure
1 parent 87ca344 commit 58104af

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

nextstrain/cli/__main__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ def reconfigure_stdio(stdio: TextIOWrapper):
2626
Suitable only for output streams (e.g. stdout, stderr), as reconfiguring an
2727
input stream is more complicated.
2828
"""
29-
# Flush any pending output under old configuration.
30-
stdio.flush()
3129

3230
# Configure new text stream on the same underlying buffered byte stream.
3331
stdio.reconfigure(
@@ -37,11 +35,7 @@ def reconfigure_stdio(stdio: TextIOWrapper):
3735
errors = "backslashreplace" if stdio is sys.stderr else "strict",
3836

3937
# Explicitly enable universal newlines mode so we do the right thing.
40-
newline = None,
41-
42-
# Preserve line buffering which is set at process start dynamically
43-
# depending on what the stdio is actually attached to.
44-
line_buffering = stdio.line_buffering)
38+
newline = None)
4539

4640

4741
# Run when called as `python -m nextstrain.cli`, here for good measure.

0 commit comments

Comments
 (0)