summaryrefslogtreecommitdiffstats
path: root/Lib/configparser.py
diff options
context:
space:
mode:
authorŁukasz Langa <lukasz@langa.pl>2013-01-01 21:36:33 (GMT)
committerŁukasz Langa <lukasz@langa.pl>2013-01-01 21:36:33 (GMT)
commit6e410a2cdb9ddb1fedecce39c57e375ea89b70c5 (patch)
tree74ab59da3a90f087afa98c12e401acf3129f1847 /Lib/configparser.py
parenta97274cbcfafda76726193958bbb1aa8b22bfb07 (diff)
parenta821f82f66260601aa184d5788226dd0c64251a0 (diff)
downloadcpython-6e410a2cdb9ddb1fedecce39c57e375ea89b70c5.zip
cpython-6e410a2cdb9ddb1fedecce39c57e375ea89b70c5.tar.gz
cpython-6e410a2cdb9ddb1fedecce39c57e375ea89b70c5.tar.bz2
Merged section order preservation fix when using `__setitem__` (issue #16820)
Diffstat (limited to 'Lib/configparser.py')
-rw-r--r--Lib/configparser.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/configparser.py b/Lib/configparser.py
index a6ac059..f9584cd 100644
--- a/Lib/configparser.py
+++ b/Lib/configparser.py
@@ -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):