(self)
| 2903 | @unittest.skip("subprocesses aren't inheriting Ctrl+C property") |
| 2904 | @support.requires_subprocess() |
| 2905 | def test_CTRL_C_EVENT(self): |
| 2906 | from ctypes import wintypes |
| 2907 | import ctypes |
| 2908 | |
| 2909 | # Make a NULL value by creating a pointer with no argument. |
| 2910 | NULL = ctypes.POINTER(ctypes.c_int)() |
| 2911 | SetConsoleCtrlHandler = ctypes.windll.kernel32.SetConsoleCtrlHandler |
| 2912 | SetConsoleCtrlHandler.argtypes = (ctypes.POINTER(ctypes.c_int), |
| 2913 | wintypes.BOOL) |
| 2914 | SetConsoleCtrlHandler.restype = wintypes.BOOL |
| 2915 | |
| 2916 | # Calling this with NULL and FALSE causes the calling process to |
| 2917 | # handle Ctrl+C, rather than ignore it. This property is inherited |
| 2918 | # by subprocesses. |
| 2919 | SetConsoleCtrlHandler(NULL, 0) |
| 2920 | |
| 2921 | self._kill_with_event(signal.CTRL_C_EVENT, "CTRL_C_EVENT") |
| 2922 | |
| 2923 | @support.requires_subprocess() |
| 2924 | def test_CTRL_BREAK_EVENT(self): |
nothing calls this directly
no test coverage detected