From a9d2e8bfafb633390876efe8fff59d01d307f2a5 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Wed, 17 May 2023 10:01:39 +0100 Subject: [PATCH] connection: Make BackgroundCommand.wait() return non-None Lack of return statement in wait() was making it return None instead of the exit code. Add appropriate return statement in wait() and other function to ensure return value is not lost. --- devlib/connection.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devlib/connection.py b/devlib/connection.py index aacb48a0f..2227c32ae 100644 --- a/devlib/connection.py +++ b/devlib/connection.py @@ -170,7 +170,7 @@ def send_signal(self, sig): :type signal: signal.Signals """ try: - self._send_signal(signal.SIGKILL) + return self._send_signal(signal.SIGKILL) finally: # Deregister if the command has finished self.poll() @@ -188,7 +188,7 @@ def cancel(self, kill_timeout=_KILL_TIMEOUT): """ try: if self.poll() is None: - self._cancel(kill_timeout=kill_timeout) + return self._cancel(kill_timeout=kill_timeout) finally: self._deregister() @@ -208,7 +208,7 @@ def wait(self): Block until the background command completes, and return its exit code. """ try: - self._wait() + return self._wait() finally: self._deregister()