浏览代码

If supervisor stdout is piped (e.g. through grep), EPIPE is raised during flush; let's not let that cause a traceback.

Chris McDonough 17 年之前
父节点
当前提交
77ee98218a
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/supervisor/loggers.py

+ 6 - 1
src/supervisor/loggers.py

@@ -65,7 +65,12 @@ class Handler:
         self.level = level
         self.level = level
 
 
     def flush(self):
     def flush(self):
-        self.stream.flush()
+        try:
+            self.stream.flush()
+        except IOError, why:
+            # if supervisor output is piped, this can be raised at exit
+            if why[0] != errno.EPIPE:
+                raise
 
 
     def close(self):
     def close(self):
         self.stream.close()
         self.stream.close()