[output] remove 'stream.reconfigure()' fallback (#7671)
This commit is contained in:
@@ -317,18 +317,7 @@ def configure_standard_streams():
|
|||||||
elif not options.get("errors"):
|
elif not options.get("errors"):
|
||||||
options["errors"] = "replace"
|
options["errors"] = "replace"
|
||||||
|
|
||||||
try:
|
stream.reconfigure(**options)
|
||||||
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),
|
|
||||||
))
|
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user