mirror of
https://github.com/python/cpython.git
synced 2025-09-25 09:50:37 +00:00
subprocess.Popen.wait doc: mention asyncio to avoid busy loop
This commit is contained in:
parent
eb44b2d9e8
commit
07171242d5
1 changed files with 6 additions and 0 deletions
|
@ -629,6 +629,12 @@ Instances of the :class:`Popen` class have the following methods:
|
||||||
:exc:`TimeoutExpired` exception. It is safe to catch this exception and
|
:exc:`TimeoutExpired` exception. It is safe to catch this exception and
|
||||||
retry the wait.
|
retry the wait.
|
||||||
|
|
||||||
|
.. 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`.
|
||||||
|
|
||||||
.. warning::
|
.. warning::
|
||||||
|
|
||||||
This will deadlock when using ``stdout=PIPE`` and/or
|
This will deadlock when using ``stdout=PIPE`` and/or
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue