Kaydet (Commit) 5da0f504 authored tarafından Barry Warsaw's avatar Barry Warsaw

get(): Fixed a bug in the merge order of the dictionaries. This makes

a copy of the defaults dictionary and merges the section's dictionary
into it so that sections can override the defaults.
üst c6c921a4
......@@ -164,13 +164,14 @@ class ConfigParser:
The section DEFAULT is special.
"""
try:
d = self.__sections[section].copy()
sectdict = self.__sections[section].copy()
except KeyError:
if section == DEFAULTSECT:
d = {}
sectdict = {}
else:
raise NoSectionError(section)
d.update(self.__defaults)
d = self.__defaults.copy()
d.update(sectdict)
option = string.lower(option)
try:
rawval = d[option]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment