bpo-35046: do only one system call per line (logging.StreamHandler) (GH-10042)

This commit is contained in:
Josh Snyder 2018-10-22 23:48:38 -07:00 committed by Vinay Sajip
parent 3b0047d8e9
commit b7d62050e7
1 changed files with 2 additions and 2 deletions

View File

@ -1091,8 +1091,8 @@ class StreamHandler(Handler):
try:
msg = self.format(record)
stream = self.stream
stream.write(msg)
stream.write(self.terminator)
# issue 35046: merged two stream.writes into one.
stream.write(msg + self.terminator)
self.flush()
except Exception:
self.handleError(record)