зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1333564 - [manifestparser] Include manifest path when raising exceptions from the ini parser, r=jmaher
MozReview-Commit-ID: 3Ns9PxVnvy5 --HG-- extra : rebase_source : 24a07462052aba712e8a2b8b1fe78ade3b1f0c5e
This commit is contained in:
Родитель
44a16cbe8a
Коммит
425c00ead0
|
@ -89,7 +89,8 @@ def read_ini(fp, variables=None, default='DEFAULT', defaults_only=False,
|
|||
|
||||
# if there aren't any sections yet, something bad happen
|
||||
if not section_names:
|
||||
raise Exception('No sections found')
|
||||
raise Exception("Error parsing manifest file '%s', line %s: No sections found" %
|
||||
(getattr(fp, 'name', 'unknown'), linenum))
|
||||
|
||||
# (key, value) pair
|
||||
for separator in separators:
|
||||
|
@ -113,12 +114,8 @@ def read_ini(fp, variables=None, default='DEFAULT', defaults_only=False,
|
|||
current_section[key] = value
|
||||
else:
|
||||
# something bad happened!
|
||||
if hasattr(fp, 'name'):
|
||||
filename = fp.name
|
||||
else:
|
||||
filename = 'unknown'
|
||||
raise Exception("Error parsing manifest file '%s', line %s" %
|
||||
(filename, linenum))
|
||||
(getattr(fp, 'name', 'unknown'), linenum))
|
||||
|
||||
# server-root is a special os path declared relative to the manifest file.
|
||||
# inheritance demands we expand it as absolute
|
||||
|
|
Загрузка…
Ссылка в новой задаче