]> granicus.if.org Git - python/commit
Implement #1220212. Add os.kill support for Windows.
authorBrian Curtin <brian.curtin@gmail.com>
Fri, 2 Apr 2010 23:26:06 +0000 (23:26 +0000)
committerBrian Curtin <brian.curtin@gmail.com>
Fri, 2 Apr 2010 23:26:06 +0000 (23:26 +0000)
commite5aa886b4449c9b2db93591c58511ea3620c9b67
treeaa333dc52ff6f99c1443b117b26c50a6afbdb7a9
parenta04c7a0f169caf09b181df05836e4cf175f37dbe
Implement #1220212. Add os.kill support for Windows.

os.kill takes one of two newly added signals, CTRL_C_EVENT and
CTRL_BREAK_EVENT, or any integer value. The events are a special case
which work with subprocess console applications which implement a
special console control handler. Any other value but those two will
cause os.kill to use TerminateProcess, outright killing the process.

This change adds win_console_handler.py, which is a script to implement
SetConsoleCtrlHandler and applicable handler function, using ctypes.

subprocess also gets another attribute which is a necessary flag to
creationflags in Popen in order to send the CTRL events.
Doc/library/os.rst
Doc/library/signal.rst
Doc/library/subprocess.rst
Lib/subprocess.py
Lib/test/test_os.py
Lib/test/win_console_handler.py [new file with mode: 0644]
Lib/unittest/test/test_break.py
Modules/posixmodule.c
Modules/signalmodule.c
PC/_subprocess.c