소스 검색

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
 
     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):
         self.stream.close()