Kaydet (Commit) 4df367c0 authored tarafından Vinay Sajip's avatar Vinay Sajip

Change to flush and close logic to fix #1760556.

üst 99479ebf
......@@ -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):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment