X-Git-Url: https://git.distorted.org.uk/~mdw/distorted-keys/blobdiff_plain/ddf8e79a6a93d1db6bf3c30d8991e86836a11d69..c122b7136af71386ac8febebcff4112805c9cacc:/extract-profile.in diff --git a/extract-profile.in b/extract-profile.in index dc816f3..918da8c 100755 --- a/extract-profile.in +++ b/extract-profile.in @@ -376,6 +376,8 @@ def parse(filename, d): continue if line[0] == '[' and line[-1] == ']': sect = line[1:-1] + if sect not in d: + d[sect] = Section(sect) continue ## Parse an assignment. @@ -393,12 +395,7 @@ def parse(filename, d): 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 + d[sect][name] = value ###-------------------------------------------------------------------------- ### Main program.