Merged parser['DEFAULT'].__setitem__ fix (issue #16820) from 3.3.

This commit is contained in:
Łukasz Langa 2012-12-31 13:57:21 +01:00
commit 8d518970ce
2 changed files with 32 additions and 1 deletions

View file

@ -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):