Skip to content

Commit 5d8d00a

Browse files
committed
[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.
1 parent de69816 commit 5d8d00a

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
@@ -770,9 +770,10 @@ Instances of the :class:`Popen` class have the following methods:
770770

771771
.. note::
772772

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

777778
.. versionchanged:: 3.3
778779
*timeout* was added.

0 commit comments

Comments
 (0)