Browse Source

Call log handler close() instead of underlying stream's close.

Ask Solem 16 năm trước cách đây
mục cha
commit
2c2e646d1c
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      celery/log.py

+ 2 - 2
celery/log.py

@@ -15,8 +15,8 @@ def setup_logger(loglevel=DAEMON_LOG_LEVEL, logfile=None, format=LOG_FORMAT,
     """
     logger = multiprocessing.get_logger()
     for handler in logger.handlers:
-        if hasattr(handler, "stream"):
-            handler.stream.close()
+        if hasattr(handler, "close"):
+            handler.close()
     logger.handlers = []
     if logfile:
         if hasattr(logfile, "write"):