Skip to content

Commit

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

* Add changelog
  • Loading branch information
varun-dc authored and Axel Goblet committed Sep 16, 2022
1 parent b04c51c commit 028b236
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 028b236

Please sign in to comment.