X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/distorted-keys/blobdiff_plain/ec2081492f7a9a50f36c507928ae6ed1af0f164b..b5991f0555161e7baf665822dac54d493209dae2:/extract-profile.in?ds=sidebyside 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.