]> granicus.if.org Git - python/commitdiff
Corrected example for replacing shell pipeline. Fixes bug 1073790.
authorPeter Astrand <astrand@lysator.liu.se>
Tue, 30 Nov 2004 18:06:42 +0000 (18:06 +0000)
committerPeter Astrand <astrand@lysator.liu.se>
Tue, 30 Nov 2004 18:06:42 +0000 (18:06 +0000)
Doc/lib/libsubprocess.tex
Lib/subprocess.py

index 01f64aeb2a9b96163eba254e2147f28a7dc10c35..77bd83e7c296d1efbdbf8aa4c2d339f9863ceb36 100644 (file)
@@ -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}
 
index db19d1ff688839f570dd5d4e5c10b9c10f65006a..8d0204e25d8ec1d8abbe48805d7b434df4e9684b 100644 (file)
@@ -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]