зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1333564 - [manifestparser] Allow multi-character comment tokens, r=jmaher
MozReview-Commit-ID: 8RDgAkBVmcK --HG-- extra : rebase_source : 1b061d9f1511c7265d1d7e2481ed1d192609d652
This commit is contained in:
Родитель
c3cc3b6407
Коммит
676b6a3311
|
@ -8,7 +8,7 @@ __all__ = ['read_ini', 'combine_fields']
|
|||
|
||||
|
||||
def read_ini(fp, variables=None, default='DEFAULT', defaults_only=False,
|
||||
comments=';#', separators=('=', ':'), strict=True,
|
||||
comments=(';', '#'), separators=('=', ':'), strict=True,
|
||||
handle_defaults=True):
|
||||
"""
|
||||
read an .ini file and return a list of [(section, values)]
|
||||
|
@ -42,7 +42,7 @@ def read_ini(fp, variables=None, default='DEFAULT', defaults_only=False,
|
|||
continue
|
||||
|
||||
# ignore comment lines
|
||||
if stripped[0] in comments:
|
||||
if any(stripped.startswith(c) for c in comments):
|
||||
continue
|
||||
|
||||
# check for a new section
|
||||
|
|
Загрузка…
Ссылка в новой задаче