summaryrefslogtreecommitdiffstats
path: root/Lib/test/win_console_handler.py
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-10-08 08:38:15 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-10-08 08:38:15 (GMT)
commit54c950f6b4e3e8449ba62c3e54445af9d273ae68 (patch)
treec8cc56f02a08d9f3d690693d8cb8b6922d7e379f /Lib/test/win_console_handler.py
parentbc95973b51abadc84960e7836ce313f12cf515cf (diff)
downloadcpython-54c950f6b4e3e8449ba62c3e54445af9d273ae68.zip
cpython-54c950f6b4e3e8449ba62c3e54445af9d273ae68.tar.gz
cpython-54c950f6b4e3e8449ba62c3e54445af9d273ae68.tar.bz2
Issue #9978: Wait until subprocess completes initialization. (Win32KillTests in test_os)
Diffstat (limited to 'Lib/test/win_console_handler.py')
-rw-r--r--Lib/test/win_console_handler.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/win_console_handler.py b/Lib/test/win_console_handler.py
index 3c2bfa1..496873c 100644
--- a/Lib/test/win_console_handler.py
+++ b/Lib/test/win_console_handler.py
@@ -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