Skip to content

Commit

Permalink
change exit() to sys.exit() (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
mski-iksm authored Sep 11, 2021
1 parent 49f23d8 commit a8e66c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gokart/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]):
Expand All @@ -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]:
Expand Down
5 changes: 3 additions & 2 deletions gokart/testing/check_if_run_with_empty_data_frame.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import sys
from typing import List, Optional

import luigi
Expand Down Expand Up @@ -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]):
Expand All @@ -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)

0 comments on commit a8e66c1

Please sign in to comment.