summaryrefslogtreecommitdiff
path: root/compose/cli/signals.py
diff options
context:
space:
mode:
Diffstat (limited to 'compose/cli/signals.py')
-rw-r--r--compose/cli/signals.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/compose/cli/signals.py b/compose/cli/signals.py
index 68a0598e..9b360c44 100644
--- a/compose/cli/signals.py
+++ b/compose/cli/signals.py
@@ -3,6 +3,8 @@ from __future__ import unicode_literals
import signal
+from ..const import IS_WINDOWS_PLATFORM
+
class ShutdownException(Exception):
pass
@@ -19,3 +21,10 @@ def set_signal_handler(handler):
def set_signal_handler_to_shutdown():
set_signal_handler(shutdown)
+
+
+def ignore_sigpipe():
+ # Restore default behavior for SIGPIPE instead of raising
+ # an exception when encountered.
+ if not IS_WINDOWS_PLATFORM:
+ signal.signal(signal.SIGPIPE, signal.SIG_DFL)