Skip to content

Commit

Permalink
fixup! Use new builtin io.TextIOWrapper.reconfigure
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin committed Nov 18, 2023
1 parent 87ca344 commit 58104af
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions nextstrain/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ def reconfigure_stdio(stdio: TextIOWrapper):
Suitable only for output streams (e.g. stdout, stderr), as reconfiguring an
input stream is more complicated.
"""
# Flush any pending output under old configuration.
stdio.flush()

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

# Explicitly enable universal newlines mode so we do the right thing.
newline = None,

# Preserve line buffering which is set at process start dynamically
# depending on what the stdio is actually attached to.
line_buffering = stdio.line_buffering)
newline = None)


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

0 comments on commit 58104af

Please sign in to comment.