1
0
mirror of https://github.com/golang/go synced 2024-11-25 07:07:57 -07:00

codereview: use subprocess.call() instead of os.spawnvp() for portability

Fixes #4121.

R=golang-dev, minux.ma, dave, r
CC=golang-dev
https://golang.org/cl/6555049
This commit is contained in:
Shivakumar GN 2012-09-27 01:50:59 +08:00 committed by Shenghou Ma
parent 60a6ae8c3c
commit b7331f9b3a

View File

@ -1772,7 +1772,7 @@ def gofmt(ui, repo, *pats, **opts):
cmd = ["gofmt", "-l"]
if not opts["list"]:
cmd += ["-w"]
if os.spawnvp(os.P_WAIT, "gofmt", cmd + files) != 0:
if subprocess.call(cmd + files) != 0:
raise hg_util.Abort("gofmt did not exit cleanly")
except hg_error.Abort, e:
raise