From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 13 Dec 2023 20:01:36 +0000 (+0100) Subject: [3.11] [doc] Make subprocess.wait documentation more precise (GH-98700) (#112154) X-Git-Tag: v3.11.8~274 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f35322502abae4fc55285e140059d4efa3a9d58c;p=thirdparty%2FPython%2Fcpython.git [3.11] [doc] Make subprocess.wait documentation more precise (GH-98700) (#112154) [doc] Make subprocess.wait documentation more precise (GH-98700) [doc] Make subprocess.wait doc more precise An active loop is only used when the `timeout` parameter is used on POSIX. When no timeout is used, the code calls `os.waitpid` internally (which puts the process on a sleep status). On Windows, the internal Windows API call accepts a timeout parameter, so that is delegated to the OS. (cherry picked from commit 81ab0e8a4add53035c87b040afda6d554cace528) Co-authored-by: Luis Pedro Coelho --- diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index e5e992c8c87f..c73b3598868f 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -793,9 +793,10 @@ Instances of the :class:`Popen` class have the following methods: .. note:: - The function is implemented using a busy loop (non-blocking call and - short sleeps). Use the :mod:`asyncio` module for an asynchronous wait: - see :class:`asyncio.create_subprocess_exec`. + When the ``timeout`` parameter is not ``None``, then (on POSIX) the + function is implemented using a busy loop (non-blocking call and short + sleeps). Use the :mod:`asyncio` module for an asynchronous wait: see + :class:`asyncio.create_subprocess_exec`. .. versionchanged:: 3.3 *timeout* was added.