diff options
Diffstat (limited to 'src/engine/SCons/Builder.py')
-rw-r--r-- | src/engine/SCons/Builder.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py index 4cce92f..bbf503c 100644 --- a/src/engine/SCons/Builder.py +++ b/src/engine/SCons/Builder.py @@ -244,7 +244,7 @@ def Builder(**kw): composite = None if 'generator' in kw: if 'action' in kw: - raise UserError, "You must not specify both an action and a generator." + raise UserError("You must not specify both an action and a generator.") kw['action'] = SCons.Action.CommandGeneratorAction(kw['generator'], {}) del kw['generator'] elif 'action' in kw: @@ -267,7 +267,7 @@ def Builder(**kw): # a callable to use as the actual emitter. var = SCons.Util.get_environment_var(emitter) if not var: - raise UserError, "Supplied emitter '%s' does not appear to refer to an Environment variable" % emitter + raise UserError("Supplied emitter '%s' does not appear to refer to an Environment variable" % emitter) kw['emitter'] = EmitterProxy(var) elif SCons.Util.is_Dict(emitter): kw['emitter'] = DictEmitter(emitter) @@ -291,7 +291,7 @@ def _node_errors(builder, env, tlist, slist): # were specified. for t in tlist: if t.side_effect: - raise UserError, "Multiple ways to build the same target were specified for: %s" % t + raise UserError("Multiple ways to build the same target were specified for: %s" % t) if t.has_explicit_builder(): if not t.env is None and not t.env is env: action = t.builder.action @@ -303,22 +303,22 @@ def _node_errors(builder, env, tlist, slist): SCons.Warnings.warn(SCons.Warnings.DuplicateEnvironmentWarning, msg) else: msg = "Two environments with different actions were specified for the same target: %s" % t - raise UserError, msg + raise UserError(msg) if builder.multi: if t.builder != builder: msg = "Two different builders (%s and %s) were specified for the same target: %s" % (t.builder.get_name(env), builder.get_name(env), t) - raise UserError, msg + raise UserError(msg) # TODO(batch): list constructed each time! if t.get_executor().get_all_targets() != tlist: msg = "Two different target lists have a target in common: %s (from %s and from %s)" % (t, list(map(str, t.get_executor().get_all_targets())), list(map(str, tlist))) - raise UserError, msg + raise UserError(msg) elif t.sources != slist: msg = "Multiple ways to build the same target were specified for: %s (from %s and from %s)" % (t, list(map(str, t.sources)), list(map(str, slist))) - raise UserError, msg + raise UserError(msg) if builder.single_source: if len(slist) > 1: - raise UserError, "More than one source given for single-source builder: targets=%s sources=%s" % (list(map(str,tlist)), list(map(str,slist))) + raise UserError("More than one source given for single-source builder: targets=%s sources=%s" % (list(map(str,tlist)), list(map(str,slist)))) class EmitterProxy: """This is a callable class that can act as a @@ -429,7 +429,7 @@ class BuilderBase: self.src_builder = src_builder def __nonzero__(self): - raise InternalError, "Do not test for the Node.builder attribute directly; use Node.has_builder() instead" + raise InternalError("Do not test for the Node.builder attribute directly; use Node.has_builder() instead") def get_name(self, env): """Attempts to get the name of the Builder. @@ -575,8 +575,8 @@ class BuilderBase: if executor is None: if not self.action: fmt = "Builder %s must have an action to build %s." - raise UserError, fmt % (self.get_name(env or self.env), - list(map(str,tlist))) + raise UserError(fmt % (self.get_name(env or self.env), + list(map(str,tlist)))) key = self.action.batch_key(env or self.env, tlist, slist) if key: try: |