1
0
mirror of https://github.com/golang/go synced 2024-11-21 19:14:44 -07:00

codereview: use cmd.communicate.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4145046
This commit is contained in:
Yasuhiro Matsumoto 2011-02-08 22:30:06 -05:00 committed by Russ Cox
parent 642c774081
commit 3108f3f4a0

View File

@ -1146,10 +1146,8 @@ def clpatch(ui, repo, clname, **opts):
except:
return "hgpatch: " + ExceptionDetail()
cmd.stdin.write(patch)
cmd.stdin.close()
out = cmd.stdout.read()
if cmd.wait() != 0 and not opts["ignore_hgpatch_failure"]:
out, err = cmd.communicate(patch)
if cmd.returncode != 0 and not opts["ignore_hgpatch_failure"]:
return "hgpatch failed"
cl.local = True
cl.files = out.strip().split()