diff --git a/testing/mozbase/manifestparser/manifestparser/ini.py b/testing/mozbase/manifestparser/manifestparser/ini.py index ab44ee2e3b83..a1ddea9cda65 100644 --- a/testing/mozbase/manifestparser/manifestparser/ini.py +++ b/testing/mozbase/manifestparser/manifestparser/ini.py @@ -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