commit | 31aa7dd14196858ed25716723f42702c96ede3bd | [log] [tgz] |
---|---|---|
author | Reid Kleckner <reid@kleckner.net> | Mon Mar 14 12:02:10 2011 -0400 |
committer | Reid Kleckner <reid@kleckner.net> | Mon Mar 14 12:02:10 2011 -0400 |
tree | bc7ce88816b0e5778b1b39f5e5379123455c31c3 | |
parent | 4169826a00bc786185cfce9371a3ba15157bf928 [diff] |
Add a 'timeout' argument to subprocess.Popen. If the timeout expires before the subprocess exits, the wait method and the communicate method will raise a subprocess.TimeoutExpired exception. When used with communicate, it is possible to catch the exception, kill the process, and retry the communicate and receive any output written to stdout or stderr.