Change to flush and close logic to fix #1760556.

This commit is contained in:
Vinay Sajip 2007-09-27 05:34:45 +00:00
parent 99479ebf9e
commit 4df367c08d

View file

@ -728,7 +728,8 @@ class StreamHandler(Handler):
""" """
Flushes the stream. Flushes the stream.
""" """
self.stream.flush() if self.stream:
self.stream.flush()
def emit(self, record): def emit(self, record):
""" """
@ -778,9 +779,11 @@ class FileHandler(StreamHandler):
""" """
Closes the stream. Closes the stream.
""" """
self.flush() if self.stream:
self.stream.close() self.flush()
StreamHandler.close(self) self.stream.close()
StreamHandler.close(self)
self.stream = None
def _open(self): def _open(self):
""" """