1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-04 22:53:42 +02:00

OscConfigParser: Remove automatic __name__ option

It's set to the section line's name on read, never read by anything in osc
and ignored on write, so it can just be removed.
This commit is contained in:
Fabian Vogt
2024-07-10 11:19:58 +02:00
parent 21c9828cd1
commit e2e0c9f365

View File

@@ -270,10 +270,7 @@ class OscConfigParser(configparser.ConfigParser):
elif sectname == configparser.DEFAULTSECT:
cursect = self._defaults
else:
#cursect = {'__name__': sectname}
#self._sections[sectname] = cursect
self.add_section(sectname)
self.set(sectname, '__name__', sectname)
# So sections can't start with a continuation line
cursect = sectname
optname = None
@@ -348,8 +345,6 @@ class OscConfigParser(configparser.ConfigParser):
ret.append('')
ret.append(f'[{line.name}]')
for sline in line._lines:
if sline.name == '__name__':
continue
if sline.type == 'option':
# special handling for continuation lines
val = '\n '.join(sline.value.split('\n'))