Commits

Patrick Mézard  committed 44514e7

Fix gofmt hook on Windows

On Windows, you cannot set close_fds to True and redirect standard
streams at the same time.

  • Participants
  • Parent commits af57329

Comments (0)

Files changed (1)

         cmd = subprocess.Popen(["gofmt", "-l"] + files,
                 shell=False, stdin=subprocess.PIPE,
                 stdout=subprocess.PIPE, stderr=subprocess.PIPE,
-                close_fds=True)
+                close_fds=os.name != 'nt')
         cmd.stdin.close()
     except OSError, CalledProcessError:
         ui.warn("gofmt: %s\n" % exceptionDetail())