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

(cherry picked from commit b7d62050e7)
This commit is contained in:
Miss Islington (bot) 2018-10-23 03:07:06 -07:00 committed by Vinay Sajip
parent 313e5015d2
commit d730719b09
1 changed files with 2 additions and 2 deletions

View File

@ -1033,8 +1033,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)