summaryrefslogtreecommitdiff
path: root/Lib/configparser.py
diff options
context:
space:
mode:
author?ukasz Langa <lukasz@langa.pl>2012-12-31 13:57:21 +0100
committer?ukasz Langa <lukasz@langa.pl>2012-12-31 13:57:21 +0100
commitdac08006f69863287e61dc7ed665d08d091cb06f (patch)
tree303d8ae5a366bffe7e817673d6c2919c31afe487 /Lib/configparser.py
parent4ca73430b7a54248d6e11609cd2c9b3377b2d202 (diff)
parent9d16a2c71b8db60797743c64f0c43407b2649d5d (diff)
downloadcpython-dac08006f69863287e61dc7ed665d08d091cb06f.tar.gz
Merged `parser['DEFAULT'].__setitem__` fix (issue #16820) from 3.3.
Diffstat (limited to 'Lib/configparser.py')
-rw-r--r--Lib/configparser.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/configparser.py b/Lib/configparser.py
index c0272cd789..a6ac059fe9 100644
--- a/Lib/configparser.py
+++ b/Lib/configparser.py
@@ -960,7 +960,10 @@ class RawConfigParser(MutableMapping):
# XXX this is not atomic if read_dict fails at any point. Then again,
# no update method in configparser is atomic in this implementation.
- self.remove_section(key)
+ if key == self.default_section:
+ self._defaults.clear()
+ else:
+ self.remove_section(key)
self.read_dict({key: value})
def __delitem__(self, key):