From 6fdf3cbb13077d44f14251034a31b512ebc9005a Mon Sep 17 00:00:00 2001 From: Peter Astrand Date: Tue, 30 Nov 2004 18:06:42 +0000 Subject: [PATCH] Corrected example for replacing shell pipeline. Fixes bug 1073790. --- Doc/lib/libsubprocess.tex | 2 +- Lib/subprocess.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/lib/libsubprocess.tex b/Doc/lib/libsubprocess.tex index 01f64aeb2a9..77bd83e7c29 100644 --- a/Doc/lib/libsubprocess.tex +++ b/Doc/lib/libsubprocess.tex @@ -239,7 +239,7 @@ output = Popen(["mycmd", "myarg"], stdout=PIPE).communicate()[0] output=`dmesg | grep hda` ==> p1 = Popen(["dmesg"], stdout=PIPE) -p2 = Popen(["grep", "hda"], stdin=p1.stdout) +p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE) output = p2.communicate()[0] \end{verbatim} diff --git a/Lib/subprocess.py b/Lib/subprocess.py index db19d1ff688..8d0204e25d8 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -229,7 +229,7 @@ Replacing shell pipe line output=`dmesg | grep hda` ==> p1 = Popen(["dmesg"], stdout=PIPE) -p2 = Popen(["grep", "hda"], stdin=p1.stdout) +p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE) output = p2.communicate()[0]