def __init__(self, node=None, errstr="Unknown error", *args):
self.node = node
self.errstr = errstr
- self.args = args
+ apply(Exception.__init__, (self,) + args)
class InternalError(Exception):
- def __init__(self, args=None):
- self.args = args
+ pass
class UserError(Exception):
- def __init__(self, args=None):
- self.args = args
+ pass
class StopError(Exception):
- def __init__(self, args=None):
- self.args = args
+ pass
class ExplicitExit(Exception):
def __init__(self, node=None, status=None, *args):
self.node = node
self.status = status
- self.args = args
+ apply(Exception.__init__, (self,) + args)
class ConfigureDryRunError(UserError):
"""Raised when a file needs to be updated during a Configure process,
self.type = type
self.value = value
self.traceback = traceback
- self.args = args
+ apply(Exception.__init__, (self,) + args)
try:
raise SCons.Errors.InternalError, "test internal error"
except SCons.Errors.InternalError, e:
- assert e.args == "test internal error"
+ assert e.args == ("test internal error",)
def test_UserError(self):
"""Test the UserError exception."""
try:
raise SCons.Errors.UserError, "test user error"
except SCons.Errors.UserError, e:
- assert e.args == "test user error"
+ assert e.args == ("test user error",)
def test_ExplicitExit(self):
"""Test the ExplicitExit exception."""
try:
raise SCons.Errors.ConfigureDryRunError, "FileName"
except SCons.Errors.UserError, e:
- assert e.args == "Cannot update configure test (FileName) within a dry-run."
+ assert e.args == ("Cannot update configure test (FileName) within a dry-run.",)
def test_TaskmasterException(self):
"""Test the TaskmasterException."""
*current call stack* rather than sys.exc_info() to get our stack trace.
This is used by the warnings framework to print warnings."""
filename, lineno, routine, dummy = find_deepest_user_frame(traceback.extract_stack())
- sys.stderr.write("\nscons: warning: %s\n" % e)
+ sys.stderr.write("\nscons: warning: %s\n" % e[0])
sys.stderr.write('File "%s", line %d, in %s\n' % (filename, lineno, routine))
def _scons_internal_error():