From: Yasuhiro Matsumoto Date: Wed, 9 Feb 2011 03:30:06 +0000 (-0500) Subject: codereview: use cmd.communicate. X-Git-Tag: weekly.2011-02-15~64 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3108f3f4a0025ad9079aa884dbf31cde268732c3;p=gostls13.git codereview: use cmd.communicate. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4145046 --- diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py index 94270f840d..96efc855b6 100644 --- a/lib/codereview/codereview.py +++ b/lib/codereview/codereview.py @@ -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()