From bb3ae48d25335918d83433a2a572364b0082f32e Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Fri, 20 Apr 2018 17:04:26 +0100 Subject: [PATCH] exception: Update "TargetNotRespondingError" syntax. Update the syntax of the TargetNotRespondingError to conform with the other exceptions of expecting a full message to be displayed rather than just a target name. --- devlib/exception.py | 4 +--- devlib/target.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/devlib/exception.py b/devlib/exception.py index 11b19e0..2925e16 100644 --- a/devlib/exception.py +++ b/devlib/exception.py @@ -25,9 +25,7 @@ class TargetError(DevlibError): class TargetNotRespondingError(DevlibError): """The target is unresponsive.""" - - def __init__(self, target): - super(TargetNotRespondingError, self).__init__('Target {} is not responding.'.format(target)) + pass class HostError(DevlibError): diff --git a/devlib/target.py b/devlib/target.py index 45d2a1b..9eaeb2a 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -455,7 +455,7 @@ class Target(object): return 1 except (TimeoutError, subprocess.CalledProcessError, TargetError): if explode: - raise TargetNotRespondingError(self.conn.name) + raise TargetNotRespondingError('Target {} is not responding'.format(self.conn.name)) return 0 # process management