summaryrefslogtreecommitdiffstats
path: root/Lib/ConfigParser.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1998-01-26 22:42:48 (GMT)
committerBarry Warsaw <barry@python.org>1998-01-26 22:42:48 (GMT)
commit5da0f504baa10c6125b5c7cc6dccc801f26f5ff0 (patch)
tree66ac490e410990804f64fee288ab14eab2f9ec86 /Lib/ConfigParser.py
parentc6c921a4def19c9b44f1e1234b35f7fb0a609731 (diff)
downloadcpython-5da0f504baa10c6125b5c7cc6dccc801f26f5ff0.zip
cpython-5da0f504baa10c6125b5c7cc6dccc801f26f5ff0.tar.gz
cpython-5da0f504baa10c6125b5c7cc6dccc801f26f5ff0.tar.bz2
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.
Diffstat (limited to 'Lib/ConfigParser.py')
-rw-r--r--Lib/ConfigParser.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/ConfigParser.py b/Lib/ConfigParser.py
index 2f3ca51..3d44bb5 100644
--- a/Lib/ConfigParser.py
+++ b/Lib/ConfigParser.py
@@ -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]