mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Fixes __setitem__
on parser['DEFAULT'] reported in issue #16820.
This commit is contained in:
parent
5da57027ef
commit
0210194d48
2 changed files with 32 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue