From 854681fcf76e6982e323628e7031c5fc0ad4f179 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Sun, 31 Oct 2021 18:42:39 +0800 Subject: Only read environment variable when it exists --- jimbrella/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'jimbrella/config.py') diff --git a/jimbrella/config.py b/jimbrella/config.py index 85833d0..e59aabc 100644 --- a/jimbrella/config.py +++ b/jimbrella/config.py @@ -1,7 +1,11 @@ import os import toml -config_path = os.environ["JIMBRELLA_CONFIG"] or "/opt/jimbrella/config.toml" +config_path = ( + os.environ["JIMBRELLA_CONFIG"] + if "JIMBRELLA_CONFIG" in os.environ + else "/opt/jimbrella/config.toml" +) f = open(config_path) config = toml.load(f) -- cgit v1.2.3