Closed matthijskooijman closed 6 years ago
Hello @matthijskooijman
Thanks for reporting the issue.
I think its best that wait
returns the retcode instead of setting itself. Thats what I have done in the commit as well.
Thanks. It seems that setting the return code in wait()
would be more like the python version, though: https://stackoverflow.com/a/5631819/740048 (but if you manually call wait, you can of course just save the retcode yourself, so it's not a very big deal).
It seems that only
Popen::poll()
setsPopen::retcode_
(which can be retrieved usingPopen::retcode()
), butPopen::communicate()
instead callsPopen::wait()
and throws away the result. I tried callingPopen::poll()
myself, but it seems that just returns 0 (IIRCwaitpid
will only work once).A simple fix seems to be to let
communicate()
doretcode_ = wait();
, which works, but I'm not sure if that's the best approach here (perhapswait()
should just set it?).