Add BackgroundCommand.communicate()#568
Conversation
Add a "cmd" attribute for better exception messages.
setrofim
left a comment
There was a problem hiding this comment.
This cannot be merged without the implementation of communicate() for all existing derivations of ConnectionBase (i.e. LocalConnection and AdbConnection).
|
@setrofim I'm not sure to understand, communicate() is a new method of BackgroundCommand, and is implemented by all its subclasses. ConnectionBase is left untouched in the operation. |
setrofim
left a comment
There was a problem hiding this comment.
D'oh. My bad. I was fooled by the collapsed code and read it as being added to ConnectionBase. My apologies.
|
No worries, GitHub is indeed not so smart in its folding. It only shows the previous "def ..." line in the hunk header, instead of doing something based on indentation |
Add a communicate() method in the style of Popen.communicate(). Unlike Popen.communicate, it will raise a CalledProcessError if the command exit with non-zero code.
8b157ca to
2c1bb42
Compare
|
EDIT: the comment was on the wrong PR and is irrelevant here |
Ease blocking interaction with a BackgroundCommand object, in the style of Popen.communicate()
Tested on paramiko and local target, but not android.