Fixes parser.clean() reported in issue #16820.

This commit is contained in:
Łukasz Langa 2012-12-31 03:38:39 +01:00
parent 3057469506
commit 3a8479a583
3 changed files with 47 additions and 1 deletions

View file

@ -851,6 +851,19 @@ class RawConfigParser(MutableMapping):
value_getter = lambda option: d[option]
return [(option, value_getter(option)) for option in d.keys()]
def popitem(self):
"""Remove a section from the parser and return it as
a (section_name, section_proxy) tuple. If no section is present, raise
KeyError.
The section DEFAULT is never returned because it cannot be removed.
"""
for key in self.sections():
value = self[key]
del self[key]
return key, value
raise KeyError
def optionxform(self, optionstr):
return optionstr.lower()