Skip to content

Commit

Permalink
Merge pull request #10 from LamaAni/fix_empty_file
Browse files Browse the repository at this point in the history
Fix empty file load
  • Loading branch information
LamaAni authored May 27, 2022
2 parents 2f33150 + 92b8c5a commit 359d6dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bole/config/cascading.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def config_file_parser(fpath: str, default_format: str = "yaml") -> dict:
with open(fpath, "r") as config_file:
config_file_text = config_file.read()

if format == "yaml":
if config_file_text.strip() == "":
as_dict = {}
elif format == "yaml":
as_dict = yaml.safe_load(config_file_text)
elif format == "json":
as_dict = json.loads(config_file_text)
Expand Down
Empty file.

0 comments on commit 359d6dc

Please sign in to comment.