diff Lib/test/win_console_handler.py @ 65173:a14e074fa42f

Issue #9978: Wait until subprocess completes initialization. (Win32KillTests in test_os)
author Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
date Fri, 08 Oct 2010 08:38:15 +0000
parents 25e8b7827c7d
children 169bf01bb507
line wrap: on
line diff
--- a/Lib/test/win_console_handler.py	Fri Oct 08 00:47:45 2010 +0000
+++ b/Lib/test/win_console_handler.py	Fri Oct 08 08:38:15 2010 +0000
@@ -11,6 +11,8 @@
 from ctypes import wintypes, WINFUNCTYPE
 import signal
 import ctypes
+import mmap
+import sys
 
 # Function prototype for the handler function. Returns BOOL, takes a DWORD.
 HandlerRoutine = WINFUNCTYPE(wintypes.BOOL, wintypes.DWORD)
@@ -38,6 +40,10 @@
         print("Unable to add SetConsoleCtrlHandler")
         exit(-1)
 
+    # Awaken mail process
+    m = mmap.mmap(-1, 1, sys.argv[1])
+    m[0] = 1
+
     # Do nothing but wait for the signal
     while True:
         pass