Bug 1162826 - Properly display full moz.build processing errors when empty KeyError or ValueError are thrown. r=mshal

This commit is contained in:
Mike Hommey 2015-05-08 11:06:39 +09:00
parent 2051207a14
commit ae6f469d5e

View File

@ -681,7 +681,7 @@ class BuildReaderError(Exception):
self._print_exception(inner, s)
def _print_keyerror(self, inner, s):
if inner.args[0] not in ('global_ns', 'local_ns'):
if not inner.args or inner.args[0] not in ('global_ns', 'local_ns'):
self._print_exception(inner, s)
return
@ -740,7 +740,7 @@ class BuildReaderError(Exception):
s.write('variables and try again.\n')
def _print_valueerror(self, inner, s):
if inner.args[0] not in ('global_ns', 'local_ns'):
if not inner.args or inner.args[0] not in ('global_ns', 'local_ns'):
self._print_exception(inner, s)
return