summaryrefslogtreecommitdiffstats
path: root/Lib/test/win_console_handler.py
diff options
context:
space:
mode:
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