[Python-checkins] cpython: subprocess.Popen.wait doc: mention asyncio to avoid busy loop

victor.stinner python-checkins at python.org
Mon Feb 24 13:19:35 CET 2014


http://hg.python.org/cpython/rev/e82e1dd7c5b2
changeset:   89363:e82e1dd7c5b2
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Feb 24 13:18:47 2014 +0100
summary:
  subprocess.Popen.wait doc: mention asyncio to avoid busy loop

files:
  Doc/library/subprocess.rst |  6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -629,6 +629,12 @@
    :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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list