Merge pull request #1742 from ysymi/1739-optmize-logging-reopen-files

Optimize the reopen_files by using FileHandler's method: close & _open
This commit is contained in:
Randall Leeds 2018-04-03 10:03:18 -07:00 committed by GitHub
commit 54e3b05e33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -377,9 +377,8 @@ class Logger(object):
handler.acquire()
try:
if handler.stream:
handler.stream.close()
handler.stream = open(handler.baseFilename,
handler.mode)
handler.close()
handler.stream = handler._open()
finally:
handler.release()