diff Lib/ConfigParser.py @ 7165:0d5a9a0e7d64 legacy-trunk

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.
author Barry Warsaw <barry@python.org>
date Mon, 26 Jan 1998 22:42:48 +0000
parents 5b24cbb1f99b
children fb4b4d069cc7
line wrap: on
line diff
--- a/Lib/ConfigParser.py	Mon Jan 26 19:16:27 1998 +0000
+++ b/Lib/ConfigParser.py	Mon Jan 26 22:42:48 1998 +0000
@@ -164,13 +164,14 @@
 	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]