codereview: fix windows

Uploading go files on Windows aborts with gofmt: exceptions.ValueError:
close_fds is not supported on Windows platforms if you redirect stdin/stdout/stderr

R=rsc, mattn, Joe Poirier
CC=golang-dev
https://golang.org/cl/4025046
This commit is contained in:
Hector Chu 2011-01-24 14:16:24 -05:00 committed by Russ Cox
parent 17fc373af7
commit 59a6395279

View file

@ -911,7 +911,7 @@ def CheckGofmt(ui, repo, files, just_warn):
if not files:
return
try:
cmd = subprocess.Popen(["gofmt", "-l"] + files, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
cmd = subprocess.Popen(["gofmt", "-l"] + files, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=sys.platform != "win32")
cmd.stdin.close()
except:
raise util.Abort("gofmt: " + ExceptionDetail())