Browse Source

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 years ago
parent
commit
77ee98218a
1 changed files with 6 additions and 1 deletions
  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()