diff options
author | Julien Palard <julien@palard.fr> | 2018-11-28 16:09:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-28 16:09:18 (GMT) |
commit | a181411f13c5dccdba9c918f86c945e8f6ab9757 (patch) | |
tree | 14e5282d058af8b43e938b656a39f1702627aaef | |
parent | dd5293871703e6a12ffdde14eeaa86a73b7b0d99 (diff) | |
download | cpython-a181411f13c5dccdba9c918f86c945e8f6ab9757.zip cpython-a181411f13c5dccdba9c918f86c945e8f6ab9757.tar.gz cpython-a181411f13c5dccdba9c918f86c945e8f6ab9757.tar.bz2 |
[3.6] Doc: Delete "how do I emulate os.kill" section in Windows FAQ (GH-10487) (GH-10768)
That section is a tip on how to kill process on Windows for Python prior to 2.7 and 3.2.
3.1 end of support was April 2012 and 2.6 was October 2013, so that hasn't been need for supported versions of Python for more than 5 years. Beside not being needed anymore for a long time, when I read it with the eyes of a Python profane, it makes Python looks bad, like a language from the parts with warts you need to circumvent.
Let's delete that :).
(cherry picked from commit a1c40014085d5cc6c12064577e8c10e7182ee9f9)
Co-authored-by: Mathieu Dupuy <deronnax@users.noreply.github.com>
-rw-r--r-- | Doc/faq/windows.rst | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/Doc/faq/windows.rst b/Doc/faq/windows.rst index 772b8c2..2b44f65 100644 --- a/Doc/faq/windows.rst +++ b/Doc/faq/windows.rst @@ -280,24 +280,3 @@ How do I check for a keypress without blocking? Use the msvcrt module. This is a standard Windows-specific extension module. It defines a function ``kbhit()`` which checks whether a keyboard hit is present, and ``getch()`` which gets one character without echoing it. - - -How do I emulate os.kill() in Windows? --------------------------------------- - -Prior to Python 2.7 and 3.2, to terminate a process, you can use :mod:`ctypes`: - -.. code-block:: python - - import ctypes - - def kill(pid): - """kill function for Win32""" - kernel32 = ctypes.windll.kernel32 - handle = kernel32.OpenProcess(1, 0, pid) - return (0 != kernel32.TerminateProcess(handle, 0)) - -In 2.7 and 3.2, :func:`os.kill` is implemented similar to the above function, -with the additional feature of being able to send :kbd:`Ctrl+C` and :kbd:`Ctrl+Break` -to console subprocesses which are designed to handle those signals. See -:func:`os.kill` for further details. |