Skip to content

Commit

Permalink
Use sys.exit instead of exit (dbt-labs#5627) (dbt-labs#5640)
Browse files Browse the repository at this point in the history
* Use sys.exit instead of exit

* Add changelog

Co-authored-by: varun-dc <91232924+varun-dc@users.noreply.github.com>
  • Loading branch information
jtcohen6 and varun-dc authored Aug 10, 2022
1 parent 6c21d10 commit 39901c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changes/unreleased/Fixes-20220808-112001.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Fixes
body: Use sys.exit instead of exit
time: 2022-08-08T11:20:01.838171926-04:00
custom:
Author: varun-dc
Issue: "5621"
PR: "5627"
3 changes: 2 additions & 1 deletion core/dbt/task/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path
import re
import shutil
import sys
from typing import Optional

import yaml
Expand Down Expand Up @@ -302,7 +303,7 @@ def run(self):
available_adapters = list(_get_adapter_plugin_names())
if not len(available_adapters):
print("No adapters available. Go to https://docs.getdbt.com/docs/available-adapters")
exit(1)
sys.exit(1)
project_name = self.get_valid_project_name()
project_path = Path(project_name)
if project_path.exists():
Expand Down

0 comments on commit 39901c5

Please sign in to comment.