]> granicus.if.org Git - python/commit
Add a 'timeout' argument to subprocess.Popen.
authorReid Kleckner <reid@kleckner.net>
Mon, 14 Mar 2011 16:02:10 +0000 (12:02 -0400)
committerReid Kleckner <reid@kleckner.net>
Mon, 14 Mar 2011 16:02:10 +0000 (12:02 -0400)
commit31aa7dd14196858ed25716723f42702c96ede3bd
treebc7ce88816b0e5778b1b39f5e5379123455c31c3
parent4169826a00bc786185cfce9371a3ba15157bf928
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.
Doc/library/subprocess.rst
Lib/subprocess.py
Lib/test/test_subprocess.py
PC/_subprocess.c