Skip to content

Commit

Permalink
dance around issue with get_config_dict triggering a (re)parse, which…
Browse files Browse the repository at this point in the history
… may be a problem for format v2 easyconfigs
  • Loading branch information
boegel committed Aug 5, 2015
1 parent 0eb05c6 commit a60754c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions easybuild/framework/easyconfig/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ def _extract_comments(self):
while rawlines[0].startswith('#'):
self.comments['header'].append(rawlines.pop(0))

parsed_ec = self.get_config_dict()

parsed_ec = None
while rawlines:
rawline = rawlines.pop(0)
if rawline.startswith('#'):
Expand All @@ -171,6 +170,11 @@ def _extract_comments(self):
self.comments['above'][key] = comment

elif '#' in rawline: # inline comment
if parsed_ec is None:
# obtain parsed easyconfig as a dict, if it wasn't already
# note: this currently trigger a reparse
parsed_ec = self.get_config_dict()

key = rawline.split('=', 1)[0].strip()
comment = rawline.rsplit('#', 1)[1].strip()

Expand Down

0 comments on commit a60754c

Please sign in to comment.