Skip to content

Commit

Permalink
Merge pull request #7134 from bluetech/rm-dupfile
Browse files Browse the repository at this point in the history
config: replace usage of py.io.dupfile
  • Loading branch information
bluetech committed Apr 30, 2020
2 parents e5d6e58 + c72a1b2 commit be68496
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/_pytest/config/__init__.py
Expand Up @@ -308,7 +308,9 @@ def __init__(self):
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)
Expand Down

0 comments on commit be68496

Please sign in to comment.