Skip to content

Instantly share code, notes, and snippets.

@sysradium
Created January 24, 2016 12:54
Show Gist options
  • Save sysradium/1d6fdcf10438ce45e6fa to your computer and use it in GitHub Desktop.
Save sysradium/1d6fdcf10438ce45e6fa to your computer and use it in GitHub Desktop.
Resolve problem with piped python script throwing BrokenPipe exceptions
from signal import signal, SIGPIPE, SIG_DFL
#Ignore SIG_PIPE and don't throw exceptions on it... (http://docs.python.org/library/signal.html)
signal(SIGPIPE,SIG_DFL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment