From 0c03132847a3d2bcbdb0b743e1472865916cced4 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 5 Feb 2020 16:18:58 -0800 Subject: [PATCH] fix error codes using sys.exit() --- jc/cli.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jc/cli.py b/jc/cli.py index 1eea2e85..3594f24c 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -82,7 +82,7 @@ __version__ = info.version def ctrlc(signum, frame): - exit(1) + sys.exit(1) def parsers_text(indent=0, pad=0): @@ -188,7 +188,7 @@ def main(): if sys.stdin.isatty(): helptext('missing piped data') - exit(1) + sys.exit(1) data = sys.stdin.read() @@ -217,11 +217,11 @@ def main(): break except: jc.utils.error_message(f'{parser_name} parser could not parse the input data. Did you use the correct parser?\n For details use the -d option.') - exit(1) + sys.exit(1) if not found: helptext('missing or incorrect arguments') - exit(1) + sys.exit(1) json_out(result, pretty=pretty)