I have used the code given here: https://stackoverflow.com/a/6001858/282155
For cmd, I am giving .exe of my c++ program. The solution given there works out for Timeout. But when my c++ program crashes in run-time I want to return non-zero from RunCmd.Run()
For this, as mentioned by Eli Bandersky in How to get exit code when using Python subprocess communicate method? I added the following line:
return self.p.returncode
But this returns zero.