Merged revisions 85315 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85315 | hirokazu.yamamoto | 2010-10-08 17:38:15 +0900 | 1 line

  Issue #9978: Wait until subprocess completes initialization. (Win32KillTests in test_os)
........
This commit is contained in:
Hirokazu Yamamoto 2010-10-08 09:41:13 +00:00
parent 354fe7e381
commit 1f504f1d7a
3 changed files with 23 additions and 2 deletions

View file

@ -11,6 +11,8 @@ similar example in C.
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 @@ if __name__ == "__main__":
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