`super()` considered super.
@@ -34,7 +34,7 @@ class RobotError(Exception):
"""
def __init__(self, message='', details=''):
- Exception.__init__(self, message)
+ super().__init__(message)
self.details = details
@property
@@ -84,7 +84,7 @@ class TimeoutError(RobotError):
"""
def __init__(self, message='', test_timeout=True):
- RobotError.__init__(self, message)
+ super().__init__(message)
self.test_timeout = test_timeout
@property
@@ -105,7 +105,7 @@ class ExecutionStatus(RobotError):
if '\r\n' in message:
message = message.replace('\r\n', '\n')
from robot.utils import cut_long_message
- RobotError.__init__(self, cut_long_message(message))
+ super().__init__(cut_long_message(message))
self.test_timeout = test_timeout
self.keyword_timeout = keyword_timeout
self.syntax = syntax
@@ -172,9 +172,8 @@ class HandlerExecutionFailed(ExecutionFailed):
exit_on_failure = self._get(error, 'EXIT_ON_FAILURE')
continue_on_failure = self._get(error, 'CONTINUE_ON_FAILURE')
skip = self._get(error, 'SKIP_EXECUTION')
- ExecutionFailed.__init__(self, details.message, test_timeout,
- keyword_timeout, syntax, exit_on_failure,
- continue_on_failure, skip)
+ super().__init__(details.message, test_timeout, keyword_timeout, syntax,
+ exit_on_failure, continue_on_failure, skip)
self.full_message = details.message
self.traceback = details.traceback
@@ -185,8 +184,8 @@ class HandlerExecutionFailed(ExecutionFailed):
class ExecutionFailures(ExecutionFailed):
def __init__(self, errors, message=None):
- message = message or self._format_message(errors)
- ExecutionFailed.__init__(self, message, **self._get_attrs(errors))
+ super().__init__(message or self._format_message(errors),
+ **self._get_attrs(errors))
self._errors = errors
def _format_message(self, errors):
@@ -235,15 +234,14 @@ class ExecutionFailures(ExecutionFailed):
class UserKeywordExecutionFailed(ExecutionFailures):
def __init__(self, run_errors=None, teardown_errors=None):
- errors = self._get_active_errors(run_errors, teardown_errors)
- message = self._get_message(run_errors, teardown_errors)
- ExecutionFailures.__init__(self, errors, message)
+ super().__init__(self._get_errors(run_errors, teardown_errors),
+ self._get_message(run_errors, teardown_errors))
if run_errors and not teardown_errors:
self._errors = run_errors.get_errors()
else:
self._errors = [self]
- def _get_active_errors(self, *errors):
+ def _get_errors(self, *errors):
return [err for err in errors if err]
def _get_message(self, run_errors, teardown_errors):
@@ -314,6 +312,6 @@ class RemoteError(RobotError):
"""Used by Remote library to report remote errors."""
def __init__(self, message='', details='', fatal=False, continuable=False):
- RobotError.__init__(self, message, details)
+ super().__init__(message, details)
self.ROBOT_EXIT_ON_FAILURE = fatal
self.ROBOT_CONTINUE_ON_FAILURE = continuable
