Bug 1162826 - Display a proper error when a moz.build tries to set a "reserved keyword". r=mshal

This commit is contained in:
Mike Hommey 2015-05-08 10:44:05 +09:00
parent c203463421
commit 53490947cc

View File

@ -202,7 +202,8 @@ class MozbuildSandbox(Sandbox):
def __setitem__(self, key, value):
if key in self.special_variables or key in self.functions or key in self.subcontext_types:
raise KeyError()
raise KeyError('Cannot set "%s" because it is a reserved keyword'
% key)
if key in self.exports:
self._context[key] = value
self.exports.remove(key)