Skip to content

Commit

Permalink
Avoid broken pipe errors
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiodsf committed Jul 11, 2023
1 parent c6d4d8a commit 3ffd708
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions seiscat/scripts/seiscat.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def run():

def main():
"""Main function. Catch KeyboardInterrupt."""
# Avoid broken pipe errors, e.g., when piping output to head
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE, SIG_DFL)
try:
run()
except KeyboardInterrupt:
Expand Down

0 comments on commit 3ffd708

Please sign in to comment.