1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-30 17:50:46 +00:00

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.
This commit is contained in:
Douglas Raillard 2023-05-17 10:01:39 +01:00 committed by Marc Bonnici
parent e6323fc8bf
commit ac0c39e31a

View File

@ -170,7 +170,7 @@ class BackgroundCommand(ABC):
:type signal: signal.Signals
"""
try:
self._send_signal(sig)
return self._send_signal(sig)
finally:
# Deregister if the command has finished
self.poll()
@ -188,7 +188,7 @@ class BackgroundCommand(ABC):
"""
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 @@ class BackgroundCommand(ABC):
Block until the background command completes, and return its exit code.
"""
try:
self._wait()
return self._wait()
finally:
self._deregister()