Skip to content

Commit d618b0c

Browse files
committed
trivial style fix
1 parent 0951130 commit d618b0c

File tree

1 file changed

+4
-2
lines changed
  • easybuild/framework/easyconfig/format

1 file changed

+4
-2
lines changed

easybuild/framework/easyconfig/format/one.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,11 @@ def _reformat_line(self, param_name, param_val, outer=False, addlen=0):
161161
if isinstance(param_val, dict):
162162
ordered_item_keys = REFORMAT_ORDERED_ITEM_KEYS.get(param_name, sorted(param_val.keys()))
163163
for item_key in ordered_item_keys:
164-
if item_key not in param_val:
164+
if item_key in param_val:
165+
item_val = param_val[item_key]
166+
else:
165167
raise EasyBuildError("Missing mandatory key '%s' in %s.", item_key, param_name)
166-
item_val = param_val[item_key]
168+
167169
comment = self._get_item_comments(param_name, item_val).get(str(item_val), '')
168170
key_pref = quote_py_str(item_key) + ': '
169171
addlen = addlen + len(INDENT_4SPACES) + len(key_pref) + len(comment)

0 commit comments

Comments
 (0)