summaryrefslogtreecommitdiff
path: root/Lib/configparser.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/configparser.py')
-rw-r--r--Lib/configparser.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/configparser.py b/Lib/configparser.py
index 243efec4bd..e5536a0024 100644
--- a/Lib/configparser.py
+++ b/Lib/configparser.py
@@ -959,7 +959,8 @@ 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 in self._sections:
+ self._sections[key].clear()
self.read_dict({key: value})
def __delitem__(self, key):