mirror of https://github.com/python/cpython.git
Change to flush and close logic to fix #1760556.
This commit is contained in:
parent
99479ebf9e
commit
4df367c08d
|
@ -728,6 +728,7 @@ def flush(self):
|
||||||
"""
|
"""
|
||||||
Flushes the stream.
|
Flushes the stream.
|
||||||
"""
|
"""
|
||||||
|
if self.stream:
|
||||||
self.stream.flush()
|
self.stream.flush()
|
||||||
|
|
||||||
def emit(self, record):
|
def emit(self, record):
|
||||||
|
@ -778,9 +779,11 @@ def close(self):
|
||||||
"""
|
"""
|
||||||
Closes the stream.
|
Closes the stream.
|
||||||
"""
|
"""
|
||||||
|
if self.stream:
|
||||||
self.flush()
|
self.flush()
|
||||||
self.stream.close()
|
self.stream.close()
|
||||||
StreamHandler.close(self)
|
StreamHandler.close(self)
|
||||||
|
self.stream = None
|
||||||
|
|
||||||
def _open(self):
|
def _open(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue