From a8e66c1dff3113abb45e8b0f390f7c0810a0f6eb Mon Sep 17 00:00:00 2001 From: mski_iksm <34547057+mski-iksm@users.noreply.github.com> Date: Sat, 11 Sep 2021 15:43:36 +0900 Subject: [PATCH] change exit() to sys.exit() (#248) --- gokart/run.py | 4 ++-- gokart/testing/check_if_run_with_empty_data_frame.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gokart/run.py b/gokart/run.py index f8cf07ac..6a415187 100644 --- a/gokart/run.py +++ b/gokart/run.py @@ -38,7 +38,7 @@ def _try_tree_info(cmdline_args): else: raise ValueError(f'--tree-info-mode must be "simple" or "all", but "{mode}" is passed.') logger.info(f'output tree info: {output_path}') - exit() + sys.exit() def _try_to_delete_unnecessary_output_file(cmdline_args: List[str]): @@ -49,7 +49,7 @@ def _try_to_delete_unnecessary_output_file(cmdline_args: List[str]): logger.info('delete-unnecessary-output-files is not support s3/gcs.') else: gokart.delete_local_unnecessary_outputs(task) - exit() + sys.exit() def _try_get_slack_api(cmdline_args: List[str]) -> Optional[gokart.slack.SlackAPI]: diff --git a/gokart/testing/check_if_run_with_empty_data_frame.py b/gokart/testing/check_if_run_with_empty_data_frame.py index 1d566ec9..e0fadfa5 100644 --- a/gokart/testing/check_if_run_with_empty_data_frame.py +++ b/gokart/testing/check_if_run_with_empty_data_frame.py @@ -1,4 +1,5 @@ import logging +import sys from typing import List, Optional import luigi @@ -70,7 +71,7 @@ def _test_run_with_empty_data_frame(cmdline_args: List[str], test_run_params: te test_logger.info('gokart test results:\n' + '\n'.join(s.format() for s in test_status_list)) if any(s.fail() for s in test_status_list): - exit(1) + sys.exit(1) def try_to_run_test_for_empty_data_frame(cmdline_args: List[str]): @@ -80,4 +81,4 @@ def try_to_run_test_for_empty_data_frame(cmdline_args: List[str]): if test_run_params.pandas: cmdline_args = [a for a in cmdline_args if not a.startswith('--test-run-')] _test_run_with_empty_data_frame(cmdline_args=cmdline_args, test_run_params=test_run_params) - exit(0) + sys.exit(0)