Skip to content

Commit

Permalink
Account for yaml.safe_load None return value
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanBryan51 committed Nov 22, 2023
1 parent 6e07808 commit 646aaae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion payu/models/cable.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def setup(self):
forcing_year_config_path = os.path.join(self.work_path, self.forcing_year_config)
if os.path.exists(forcing_year_config_path):
with open(forcing_year_config_path, 'r') as file:
forcing_year_config = yaml.safe_load(file)
conf = yaml.safe_load(file)
forcing_year_config = conf if conf else {}
self._update_forcing(year, **forcing_year_config)

# Write modified namelist file to work dir
Expand Down

0 comments on commit 646aaae

Please sign in to comment.