1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-11 21:29:25 +01:00

Merge pull request #1601 from Vogtinator/no__name__

OscConfigParser: Remove automatic __name__ option
This commit is contained in:
Daniel Mach 2024-07-15 09:06:16 +02:00 committed by GitHub
commit d468bd692f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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'))