fix(api): duplicate exception raising and close file
This commit is contained in:
parent
ad7686e8a7
commit
401808d7d1
2 changed files with 12 additions and 19 deletions
|
@ -1,6 +1,4 @@
|
|||
import configparser
|
||||
import os
|
||||
import sys
|
||||
|
||||
from .utils import get_random_string, read_config_file
|
||||
|
||||
|
@ -15,13 +13,7 @@ LIBRETIME_STATIC_ROOT = os.getenv(
|
|||
"LIBRETIME_STATIC_ROOT",
|
||||
"/usr/share/airtime/api",
|
||||
)
|
||||
|
||||
try:
|
||||
CONFIG = read_config_file(LIBRETIME_CONFIG_FILEPATH)
|
||||
except IOError as e:
|
||||
print(f"Unable to read config file {LIBRETIME_CONFIG_FILEPATH}", file=sys.stderr)
|
||||
print(e, file=sys.stderr)
|
||||
CONFIG = configparser.ConfigParser()
|
||||
CONFIG = read_config_file(LIBRETIME_CONFIG_FILEPATH)
|
||||
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue