Skip to content

Commit df178f9

Browse files
committed
tr: handle empty yaml files correctly
Treat empty yaml files as valid empty dictionaries. Signed-off-by: Omer Caspi <omer.caspi@gmail.com>
1 parent 966e867 commit df178f9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/tr/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def _read_config_file(file_path: str) -> ConfigFileModel:
121121
if ext == ".json":
122122
data: dict = json.load(open(file_path, 'r'))
123123
elif ext == ".yaml" or ext == ".yml":
124-
data: dict = yaml.safe_load(open(file_path, 'r'))
124+
data: dict = yaml.safe_load(open(file_path, 'r')) or {}
125125
else:
126126
raise TaskException("Unsupported configuration file format")
127127
return validate_config_file_schema(data)

0 commit comments

Comments
 (0)