From 31aa7dd14196858ed25716723f42702c96ede3bd Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Mon, 14 Mar 2011 12:02:10 -0400 Subject: 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. --- PC/_subprocess.c | 1 + 1 file changed, 1 insertion(+) (limited to 'PC/_subprocess.c') diff --git a/PC/_subprocess.c b/PC/_subprocess.c index 2338f3085b..f11e3e3a16 100644 --- a/PC/_subprocess.c +++ b/PC/_subprocess.c @@ -682,6 +682,7 @@ PyInit__subprocess() defint(d, "SW_HIDE", SW_HIDE); defint(d, "INFINITE", INFINITE); defint(d, "WAIT_OBJECT_0", WAIT_OBJECT_0); + defint(d, "WAIT_TIMEOUT", WAIT_TIMEOUT); defint(d, "CREATE_NEW_CONSOLE", CREATE_NEW_CONSOLE); defint(d, "CREATE_NEW_PROCESS_GROUP", CREATE_NEW_PROCESS_GROUP); -- cgit v1.2.1