1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

fix brek on pipe error

This commit is contained in:
Kelly Brazil
2020-04-09 13:38:33 -07:00
parent 7f869b4b18
commit 99f7842dee
3 changed files with 11 additions and 2 deletions

View File

@ -18,7 +18,7 @@ import jc.utils
class info():
version = '1.10.2'
version = '1.10.3'
description = 'jc cli output JSON conversion tool'
author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com'
@ -289,6 +289,12 @@ def main():
# break on ctrl-c keyboard interrupt
signal.signal(signal.SIGINT, ctrlc)
# break on pipe error. need try/except for windows compatibility
try:
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
except AttributeError:
pass
# try magic syntax first: e.g. jc -p ls -al
magic()