From 2bf4d8a433b0b974524d0f6ce98e9f20e4fa588f Mon Sep 17 00:00:00 2001 From: Douglas RAILLARD Date: Thu, 5 Dec 2019 15:51:38 +0000 Subject: [PATCH] target: Return a bool in Target.check_responsive() Since bool is a subclass of int, turning 0 into False and 1 into True should not break any user code. --- devlib/target.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devlib/target.py b/devlib/target.py index 2086433..eb0b48c 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -546,11 +546,11 @@ class Target(object): def check_responsive(self, explode=True): try: self.conn.execute('ls /', timeout=5) - return 1 + return True except (DevlibTransientError, subprocess.CalledProcessError): if explode: raise TargetNotRespondingError('Target {} is not responding'.format(self.conn.name)) - return 0 + return False # process management