Skip to content

Commit 100370c

Browse files
committed
super() considered super.
1 parent 382b238 commit 100370c

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

‎src/robot/errors.py‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class RobotError(Exception):
3434
"""
3535

3636
def __init__(self, message='', details=''):
37-
Exception.__init__(self, message)
37+
super().__init__(message)
3838
self.details = details
3939

4040
@property
@@ -84,7 +84,7 @@ class TimeoutError(RobotError):
8484
"""
8585

8686
def __init__(self, message='', test_timeout=True):
87-
RobotError.__init__(self, message)
87+
super().__init__(message)
8888
self.test_timeout = test_timeout
8989

9090
@property
@@ -105,7 +105,7 @@ def __init__(self, message, test_timeout=False, keyword_timeout=False,
105105
if '\r\n' in message:
106106
message = message.replace('\r\n', '\n')
107107
from robot.utils import cut_long_message
108-
RobotError.__init__(self, cut_long_message(message))
108+
super().__init__(cut_long_message(message))
109109
self.test_timeout = test_timeout
110110
self.keyword_timeout = keyword_timeout
111111
self.syntax = syntax
@@ -172,9 +172,8 @@ def __init__(self, details):
172172
exit_on_failure = self._get(error, 'EXIT_ON_FAILURE')
173173
continue_on_failure = self._get(error, 'CONTINUE_ON_FAILURE')
174174
skip = self._get(error, 'SKIP_EXECUTION')
175-
ExecutionFailed.__init__(self, details.message, test_timeout,
176-
keyword_timeout, syntax, exit_on_failure,
177-
continue_on_failure, skip)
175+
super().__init__(details.message, test_timeout, keyword_timeout, syntax,
176+
exit_on_failure, continue_on_failure, skip)
178177
self.full_message = details.message
179178
self.traceback = details.traceback
180179

@@ -185,8 +184,8 @@ def _get(self, error, attr):
185184
class ExecutionFailures(ExecutionFailed):
186185

187186
def __init__(self, errors, message=None):
188-
message = message or self._format_message(errors)
189-
ExecutionFailed.__init__(self, message, **self._get_attrs(errors))
187+
super().__init__(message or self._format_message(errors),
188+
**self._get_attrs(errors))
190189
self._errors = errors
191190

192191
def _format_message(self, errors):
@@ -235,15 +234,14 @@ def get_errors(self):
235234
class UserKeywordExecutionFailed(ExecutionFailures):
236235

237236
def __init__(self, run_errors=None, teardown_errors=None):
238-
errors = self._get_active_errors(run_errors, teardown_errors)
239-
message = self._get_message(run_errors, teardown_errors)
240-
ExecutionFailures.__init__(self, errors, message)
237+
super().__init__(self._get_errors(run_errors, teardown_errors),
238+
self._get_message(run_errors, teardown_errors))
241239
if run_errors and not teardown_errors:
242240
self._errors = run_errors.get_errors()
243241
else:
244242
self._errors = [self]
245243

246-
def _get_active_errors(self, *errors):
244+
def _get_errors(self, *errors):
247245
return [err for err in errors if err]
248246

249247
def _get_message(self, run_errors, teardown_errors):
@@ -314,6 +312,6 @@ class RemoteError(RobotError):
314312
"""Used by Remote library to report remote errors."""
315313

316314
def __init__(self, message='', details='', fatal=False, continuable=False):
317-
RobotError.__init__(self, message, details)
315+
super().__init__(message, details)
318316
self.ROBOT_EXIT_ON_FAILURE = fatal
319317
self.ROBOT_CONTINUE_ON_FAILURE = continuable

0 commit comments

Comments
 (0)