mirror of
https://github.com/python/cpython.git
synced 2025-07-29 22:24:49 +00:00
Change to flush and close logic to fix #1760556.
This commit is contained in:
parent
99479ebf9e
commit
4df367c08d
1 changed files with 7 additions and 4 deletions
|
@ -728,7 +728,8 @@ class StreamHandler(Handler):
|
|||
"""
|
||||
Flushes the stream.
|
||||
"""
|
||||
self.stream.flush()
|
||||
if self.stream:
|
||||
self.stream.flush()
|
||||
|
||||
def emit(self, record):
|
||||
"""
|
||||
|
@ -778,9 +779,11 @@ class FileHandler(StreamHandler):
|
|||
"""
|
||||
Closes the stream.
|
||||
"""
|
||||
self.flush()
|
||||
self.stream.close()
|
||||
StreamHandler.close(self)
|
||||
if self.stream:
|
||||
self.flush()
|
||||
self.stream.close()
|
||||
StreamHandler.close(self)
|
||||
self.stream = None
|
||||
|
||||
def _open(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue