]> Cypherpunks repositories - gostls13.git/commitdiff
codereview: use cmd.communicate.
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Wed, 9 Feb 2011 03:30:06 +0000 (22:30 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 9 Feb 2011 03:30:06 +0000 (22:30 -0500)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4145046

lib/codereview/codereview.py

index 94270f840d2e8fd7556576af61a6a1c9b37d914a..96efc855b6044a6dbfd7753c1e81474657542cba 100644 (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()