Skip to content

Commit f353225

Browse files
[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 81ab0e8) Co-authored-by: Luis Pedro Coelho <luis@luispedro.org>
1 parent 4c45927 commit f353225

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Doc/library/subprocess.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,9 +793,10 @@ Instances of the :class:`Popen` class have the following methods:
793793

794794
.. note::
795795

796-
The function is implemented using a busy loop (non-blocking call and
797-
short sleeps). Use the :mod:`asyncio` module for an asynchronous wait:
798-
see :class:`asyncio.create_subprocess_exec`.
796+
When the ``timeout`` parameter is not ``None``, then (on POSIX) the
797+
function is implemented using a busy loop (non-blocking call and short
798+
sleeps). Use the :mod:`asyncio` module for an asynchronous wait: see
799+
:class:`asyncio.create_subprocess_exec`.
799800

800801
.. versionchanged:: 3.3
801802
*timeout* was added.

0 commit comments

Comments
 (0)