Merge pull request #7134 from bluetech/rm-dupfile

config: replace usage of py.io.dupfile
This commit is contained in:
Ran Benita 2020-04-30 14:07:52 +03:00 committed by GitHub
commit be68496440
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -308,7 +308,9 @@ class PytestPluginManager(PluginManager):
err = sys.stderr
encoding = getattr(err, "encoding", "utf8")
try:
err = py.io.dupfile(err, encoding=encoding)
err = open(
os.dup(err.fileno()), mode=err.mode, buffering=1, encoding=encoding,
)
except Exception:
pass
self.trace.root.setwriter(err.write)