changeset 121:72c02b640dcf

Escape presses simultaneous with the testee exiting no longer cancel on Win32
author Oleg Oshmyan <chortos@inbox.lv>
date Sat, 23 Apr 2011 01:16:57 +0300
parents 08a1d6cc5948
children d6fd880207cb
files win32.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/win32.py	Thu Apr 21 22:39:23 2011 +0300
+++ b/win32.py	Sat Apr 23 01:16:57 2011 +0300
@@ -489,14 +489,14 @@
 		else:
 			case.process.wait()
 	else:
-		handles = stdin, case.process._handle
+		handles = case.process._handle, stdin
 		if case.maxwalltime:
 			time_end = clock() + case.maxwalltime
 			while case.process.poll() is None:
 				remaining = time_end - clock()
 				if remaining > 0:
 					if (WaitForMultipleObjects(handles, False, remaining) ==
-					    WAIT_OBJECT_0):
+					    WAIT_OBJECT_0 + 1):
 						ir = ReadConsoleInput(stdin)
 						if (ir and
 						    ir.EventType == KEY_EVENT and
@@ -508,7 +508,7 @@
 		else:
 			while case.process.poll() is None:
 				if (WaitForMultipleObjects(handles, False, INFINITE) ==
-				    WAIT_OBJECT_0):
+				    WAIT_OBJECT_0 + 1):
 					ir = ReadConsoleInput(stdin)
 					if (ir and
 					    ir.EventType == KEY_EVENT and