I'm finally porting Carthage from sh 1.x to sh 2.x. We had our own hack to enable async for sh, and we had a lot of code that did things like
result = await sh.ssh(...)
And then for example looked at result.stdout.
So, part of this can be handled by setting _return_cmd=True, but the definition of RunningCommand.__await__ is hard-coded to return str(self).
Obviously, I can do something like
result = sh.ssh(...)
await result
But that feels clumsy.
I'd like a kwarg that returns a RunningCommand even on async await.
My preference would be to try and convince you that _return_cmd should affect await as well as call, but if you are concerned about the API instability, I'm happy with anything that I can pass into bake.
Thanks for your consideration.
I'm finally porting Carthage from sh 1.x to sh 2.x. We had our own hack to enable async for sh, and we had a lot of code that did things like
And then for example looked at
result.stdout.So, part of this can be handled by setting
_return_cmd=True, but the definition ofRunningCommand.__await__is hard-coded to returnstr(self).Obviously, I can do something like
But that feels clumsy.
I'd like a kwarg that returns a RunningCommand even on async await.
My preference would be to try and convince you that
_return_cmdshould affect await as well as call, but if you are concerned about the API instability, I'm happy with anything that I can pass into bake.Thanks for your consideration.