[output] remove 'stream.reconfigure()' fallback (#7671)

This commit is contained in:
Mike Fährmann
2025-08-03 09:19:32 +02:00
parent 8ee12279c7
commit f00157da40

View File

@@ -317,18 +317,7 @@ def configure_standard_streams():
elif not options.get("errors"):
options["errors"] = "replace"
try:
stream.reconfigure(**options)
except AttributeError:
# no 'reconfigure' support
oget = options.get
setattr(sys, name, stream.__class__(
stream.buffer,
encoding=oget("encoding", stream.encoding),
errors=oget("errors", "replace"),
newline=oget("newline", stream.newlines),
line_buffering=oget("line_buffering", stream.line_buffering),
))
stream.reconfigure(**options)
# --------------------------------------------------------------------