Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

Commit ac0c39e

Browse files
douglas-raillard-armmarcbonnici
authored andcommitted
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.
1 parent e6323fc commit ac0c39e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

devlib/connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def send_signal(self, sig):
170170
:type signal: signal.Signals
171171
"""
172172
try:
173-
self._send_signal(sig)
173+
return self._send_signal(sig)
174174
finally:
175175
# Deregister if the command has finished
176176
self.poll()
@@ -188,7 +188,7 @@ def cancel(self, kill_timeout=_KILL_TIMEOUT):
188188
"""
189189
try:
190190
if self.poll() is None:
191-
self._cancel(kill_timeout=kill_timeout)
191+
return self._cancel(kill_timeout=kill_timeout)
192192
finally:
193193
self._deregister()
194194

@@ -208,7 +208,7 @@ def wait(self):
208208
Block until the background command completes, and return its exit code.
209209
"""
210210
try:
211-
self._wait()
211+
return self._wait()
212212
finally:
213213
self._deregister()
214214

0 commit comments

Comments
 (0)