mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-03-21 18:50:38 +03:00
Added fix for _handle_comment
This commit is contained in:
parent
beb555bdf2
commit
51f4b3aa18
@ -82,12 +82,12 @@ class GpoaConfigObj(ConfigObj):
|
||||
|
||||
def _handle_comment(self, comment):
|
||||
"""Deal with a comment."""
|
||||
if not comment.strip():
|
||||
return comment or '' # return trailing whitespace as-is
|
||||
if not comment:
|
||||
return ''
|
||||
start = self.indent_type
|
||||
if not (comment.lstrip().startswith('#') or comment.lstrip().startswith(';')):
|
||||
if not comment.lstrip().startswith(tuple(self.COMMENT_MARKERS)):
|
||||
start += ' # '
|
||||
return (start + comment)
|
||||
return start + comment.strip()
|
||||
|
||||
def _parse(self, infile):
|
||||
"""Actually parse the config file."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user