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
commit8d518970ce30387db8168ea45402a871167562df (patch)
treea82df5f34c385b66c6841841a2688248aadf7a56 /Lib/configparser.py
parent528b825cb1db4611c80ea2dff74b47eb71a4d029 (diff)
parent0210194d48569ce136bad4d324ade03767356905 (diff)
downloadcpython-git-8d518970ce30387db8168ea45402a871167562df.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):