pexpect / ptyprocess

Run a subprocess in a pseudo terminal
https://ptyprocess.readthedocs.io/en/latest/
Other
222 stars 71 forks source link

wait(): return exit status instead of raising an exception #14

Closed reynir closed 9 years ago

reynir commented 9 years ago

Fixes #13. I thought the fix would be more complicated, but it seems isalive() will set all the needed fields if the child has terminated.

I am not familiar with the unit testing framework, so the test may not be very idiomatic.

takluyver commented 9 years ago

Thanks, I think this makes sense - though we should decide what we're doing in Pexpect before we merge, otherwise we'll probably forget and the API will just change.

I think this means that p.wait() can also now be called twice on the same process - do you want to add a test case for that?

jquast commented 9 years ago

I'll be happy to pull in reynir:master and add a TestCase for it.

jquast commented 9 years ago

Thanks again for your contribution @reynir, this was refactored into PR #14, I hope for it to be accepted and released soon.

The downstream dependency of pexpect is slating for a major v4.0 release. We have a few changes to kink out so that might take a bit longer, but hopefully not by much!