mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue #9978: Wait until subprocess completes initialization. (Win32KillTests in test_os)
This commit is contained in:
parent
bc95973b51
commit
54c950f6b4
3 changed files with 23 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue