1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-27 02:16:12 +01:00

- allow empty config values (e.g. "foo=")

This commit is contained in:
Marcus Hüwe 2009-09-16 23:28:20 +00:00
parent 6ca6a10955
commit b195202be5

View File

@ -105,12 +105,12 @@ class SectionLine(Line):
return None
def _add_option(self, optname, value = None, line = None, sep = '='):
if not (value or line):
raise Error('Either value or line must be passed in')
if value is None and line is None:
raise ConfigParser.Error('Either value or line must be passed in')
elif value and line:
raise Error('value and line are mutually exclusive')
raise ConfigParser.Error('value and line are mutually exclusive')
if value:
if value is not None:
line = '%s%s%s' % (optname, sep, value)
opt = self._find(optname)
if opt: