Remove an option.
(self, section, option)
| 992 | fp.write("\n") |
| 993 | |
| 994 | def remove_option(self, section, option): |
| 995 | """Remove an option.""" |
| 996 | if not section or section == self.default_section: |
| 997 | sectdict = self._defaults |
| 998 | else: |
| 999 | try: |
| 1000 | sectdict = self._sections[section] |
| 1001 | except KeyError: |
| 1002 | raise NoSectionError(section) from None |
| 1003 | option = self.optionxform(option) |
| 1004 | existed = option in sectdict |
| 1005 | if existed: |
| 1006 | del sectdict[option] |
| 1007 | return existed |
| 1008 | |
| 1009 | def remove_section(self, section): |
| 1010 | """Remove a file section.""" |
no test coverage detected