From a921c3f9497513ec3fcb10a367368b2efc2303d2 Mon Sep 17 00:00:00 2001 From: Greg Noel Date: Thu, 15 Apr 2010 00:02:59 +0000 Subject: http://scons.tigris.org/issues/show_bug.cgi?id=2345 Apply the first part of the 'raise' fixer (the three-argument cases are not converted and will need to wait until native support of with_traceback() is available). --- bench/dependency-func.py | 2 +- bench/env.__setitem__.py | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'bench') diff --git a/bench/dependency-func.py b/bench/dependency-func.py index beaa6266..7313cf97 100644 --- a/bench/dependency-func.py +++ b/bench/dependency-func.py @@ -26,7 +26,7 @@ def use_if_tests(env, dep, arg): elif t == '4444': func = dep.func4 else: - raise Exception, "bad key %s" % t + raise Exception("bad key %s" % t) return func(arg) diff --git a/bench/env.__setitem__.py b/bench/env.__setitem__.py index 36a76727..831a5071 100644 --- a/bench/env.__setitem__.py +++ b/bench/env.__setitem__.py @@ -115,7 +115,7 @@ class env_Original(Environment): special(self, key, value) else: if not SCons.Environment.is_valid_construction_var(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value class env_Global_is_valid(Environment): @@ -126,7 +126,7 @@ class env_Global_is_valid(Environment): special(self, key, value) else: if not is_valid_construction_var(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value class env_Method_is_valid(Environment): @@ -143,7 +143,7 @@ class env_Method_is_valid(Environment): special(self, key, value) else: if not self.is_valid_construction_var(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value class env_regex_attribute_is_valid(Environment): @@ -154,7 +154,7 @@ class env_regex_attribute_is_valid(Environment): special(self, key, value) else: if not self._valid_var.match(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value class env_global_regex_is_valid(Environment): @@ -165,7 +165,7 @@ class env_global_regex_is_valid(Environment): special(self, key, value) else: if not global_valid_var.match(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value class env_special_set_has_key(Environment): @@ -175,7 +175,7 @@ class env_special_set_has_key(Environment): self._special_set[key](self, key, value) else: if not SCons.Environment.is_valid_construction_var(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value class env_key_in_tuple(Environment): @@ -185,7 +185,7 @@ class env_key_in_tuple(Environment): self._special_set[key](self, key, value) else: if not SCons.Environment.is_valid_construction_var(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value class env_key_in_list(Environment): @@ -195,7 +195,7 @@ class env_key_in_list(Environment): self._special_set[key](self, key, value) else: if not SCons.Environment.is_valid_construction_var(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value class env_key_in_attribute(Environment): @@ -205,7 +205,7 @@ class env_key_in_attribute(Environment): self._special_set[key](self, key, value) else: if not SCons.Environment.is_valid_construction_var(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value class env_try_except(Environment): @@ -219,7 +219,7 @@ class env_try_except(Environment): self._dict[key] except KeyError: if not SCons.Environment.is_valid_construction_var(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value class env_not_has_key(Environment): @@ -231,7 +231,7 @@ class env_not_has_key(Environment): else: if key not in self._dict \ and not SCons.Environment.is_valid_construction_var(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value class env_Best_attribute(Environment): @@ -242,7 +242,7 @@ class env_Best_attribute(Environment): else: if key not in self._dict \ and not global_valid_var.match(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value class env_Best_has_key(Environment): @@ -253,7 +253,7 @@ class env_Best_has_key(Environment): else: if key not in self._dict \ and not global_valid_var.match(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value class env_Best_list(Environment): @@ -264,7 +264,7 @@ class env_Best_list(Environment): else: if key not in self._dict \ and not global_valid_var.match(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value try: @@ -279,7 +279,7 @@ else: self._special_set[key](self, key, value) else: if not key.isalnum() and not global_valid_var.match(key): - raise SCons.Errors.UserError, "Illegal construction variable `%s'" % key + raise SCons.Errors.UserError("Illegal construction variable `%s'" % key) self._dict[key] = value # We'll use the names of all the env_* classes we find later to build -- cgit v1.2.1