From: Victor Stinner Date: Mon, 24 Feb 2014 12:18:47 +0000 (+0100) Subject: subprocess.Popen.wait doc: mention asyncio to avoid busy loop X-Git-Tag: v3.4.1rc1~233^2~216^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07171242d5ea3bc56a05a548ffa2deb9e0e5420d;p=python subprocess.Popen.wait doc: mention asyncio to avoid busy loop --- diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index 1a9dd9d390..f03c322942 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -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 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:: This will deadlock when using ``stdout=PIPE`` and/or