Create a section as soon as we see a section header; we no longer need
the more complicated lazy creation code.
continue
if line[0] == '[' and line[-1] == ']':
sect = line[1:-1]
continue
if line[0] == '[' and line[-1] == ']':
sect = line[1:-1]
+ if sect not in d:
+ d[sect] = Section(sect)
continue
## Parse an assignment.
continue
## Parse an assignment.
raise UserError, "%s:%d: bad name `%s'" % (filename, n, name)
## Store the assignment.
raise UserError, "%s:%d: bad name `%s'" % (filename, n, name)
## Store the assignment.
- try:
- d[sect][name] = value
- except KeyError:
- s = Section(sect)
- d[sect] = s
- s[name] = value
###--------------------------------------------------------------------------
### Main program.
###--------------------------------------------------------------------------
### Main program.