]> Cypherpunks repositories - gostls13.git/commitdiff
codereview: fix windows
authorHector Chu <hectorchu@gmail.com>
Mon, 24 Jan 2011 19:16:24 +0000 (14:16 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 24 Jan 2011 19:16:24 +0000 (14:16 -0500)
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

lib/codereview/codereview.py

index 44279d77a8ba4afeda1da9704202d22a21b4b27e..8b9dc81c294340839593b2b418e2c5d49ef571af 100644 (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())