Skip to content

Commit

Permalink
Simplify EasyConfig.asdict to a dict comprehension
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Jan 3, 2025
1 parent 83be34d commit 2a63863
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions easybuild/framework/easyconfig/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -1899,15 +1899,9 @@ def asdict(self):
"""
Return dict representation of this EasyConfig instance.
"""
res = {}
# Not all values can be resolved, e.g. %(installdir)s
with self.allow_unresolved_templates():
for key, tup in self._config.items():
value = tup[0]
if self._templating_enabled:
value = self.resolve_template(value)
res[key] = value
return res
return {key: self[key] for key in self._config}

def get_cuda_cc_template_value(self, key):
"""
Expand Down

0 comments on commit 2a63863

Please sign in to comment.