mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
configparser: preserve section order when using __setitem__
(issue #16820)
This commit is contained in:
parent
eb6aa5c525
commit
a821f82f66
2 changed files with 6 additions and 2 deletions
|
@ -962,8 +962,8 @@ class RawConfigParser(MutableMapping):
|
|||
# no update method in configparser is atomic in this implementation.
|
||||
if key == self.default_section:
|
||||
self._defaults.clear()
|
||||
else:
|
||||
self.remove_section(key)
|
||||
elif key in self._sections:
|
||||
self._sections[key].clear()
|
||||
self.read_dict({key: value})
|
||||
|
||||
def __delitem__(self, key):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue