(self)
| 121 | @unittest.skip("subprocesses aren't inheriting Ctrl+C property") |
| 122 | @support.requires_subprocess() |
| 123 | def test_CTRL_C_EVENT(self): |
| 124 | from ctypes import wintypes |
| 125 | import ctypes |
| 126 | |
| 127 | # Make a NULL value by creating a pointer with no argument. |
| 128 | NULL = ctypes.POINTER(ctypes.c_int)() |
| 129 | SetConsoleCtrlHandler = ctypes.windll.kernel32.SetConsoleCtrlHandler |
| 130 | SetConsoleCtrlHandler.argtypes = (ctypes.POINTER(ctypes.c_int), |
| 131 | wintypes.BOOL) |
| 132 | SetConsoleCtrlHandler.restype = wintypes.BOOL |
| 133 | |
| 134 | # Calling this with NULL and FALSE causes the calling process to |
| 135 | # handle Ctrl+C, rather than ignore it. This property is inherited |
| 136 | # by subprocesses. |
| 137 | SetConsoleCtrlHandler(NULL, 0) |
| 138 | |
| 139 | self._kill_with_event(signal.CTRL_C_EVENT, "CTRL_C_EVENT") |
| 140 | |
| 141 | @support.requires_subprocess() |
| 142 | def test_CTRL_BREAK_EVENT(self): |
nothing calls this directly
no test coverage detected